-
-
Save TristinDavis/4095299 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
#!/usr/bin/env perl | |
use Mojolicious::Lite; | |
use Coro; | |
use Mojo::IOLoop; | |
Mojo::IOLoop->recurring(0 => sub {cede}); | |
hook around_dispatch => sub { | |
my $next = shift; | |
async { $next->() }; | |
}; | |
get '/' => sub { | |
my $self = shift; | |
$self->render(text => 'Async!'); | |
}; | |
app->start; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment