Created
October 6, 2010 12:44
-
-
Save sharifulin/613288 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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