Skip to content

Instantly share code, notes, and snippets.

@sharifulin
Created October 6, 2010 12:44
Show Gist options
  • Save sharifulin/613288 to your computer and use it in GitHub Desktop.
Save sharifulin/613288 to your computer and use it in GitHub Desktop.
# don't work
use Mojolicious::Lite;
my $loop = app->client->ioloop;
$loop->timer(5 => sub {
my $self = shift;
warn 1111;
});
get '/' => 'index';
app->start;
# it works, but uses another loops
use Mojolicious::Lite;
use Mojo::IOLoop;
my $loop = Mojo::IOLoop->singleton;
$loop->timer(5 => sub {
my $self = shift;
warn 1111;
});
get '/' => 'index';
app->start;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment