Skip to content

Instantly share code, notes, and snippets.

@TristinDavis
Forked from kraih/coro-skeleton.pl
Created November 17, 2012 12:02
Show Gist options
  • Save TristinDavis/4095299 to your computer and use it in GitHub Desktop.
Save TristinDavis/4095299 to your computer and use it in GitHub Desktop.
#!/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