Skip to content

Instantly share code, notes, and snippets.

@bimmerlabs
Created October 27, 2017 14:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bimmerlabs/d5891302a3d0593a995ef2cd3c131497 to your computer and use it in GitHub Desktop.
Save bimmerlabs/d5891302a3d0593a995ef2cd3c131497 to your computer and use it in GitHub Desktop.
If I comment out the line with 'test2' it works - but otherwise, it times out. What am I missing? taken from http://bit.ly/2zJHEK1
use Mojolicious::Lite;
use Mojo::IOLoop;
get '/' => sub {
my $c = shift;
$c->delay(
sub { say 'test1'; Mojo::IOLoop->timer(1 => shift->begin); },
sub { say 'test2'; my $test = 'test'; },
sub { say 'test3'; $c->render(text => 'Hi'); },
);
};
app->start;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment