Skip to content

Instantly share code, notes, and snippets.

@sugar84
Created September 20, 2011 21:30
Show Gist options
  • Select an option

  • Save sugar84/1230440 to your computer and use it in GitHub Desktop.

Select an option

Save sugar84/1230440 to your computer and use it in GitHub Desktop.
mojox_run hangs
#!/usr/bin/env perl
use common::sense;
use Data::Dumper;
use MojoX::Run;
use Mojolicious;
say $Mojolicious::VERSION;
my $sub = sub {
return "hello", "world";
};
my $mojox = MojoX::Run->new;
say "hello";
my $pid = $mojox->spawn_sub(
$sub,
exec_timeout => 6,
exec_cb => sub {
my ($pid, $res, $except) = @_;
warn $except if $except;
warn $res;
$mojox->ioloop->stop;
},
);
$mojox->ioloop->start;
say "go go";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment