Skip to content

Instantly share code, notes, and snippets.

@ian-kent
Created July 11, 2013 09:00
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 ian-kent/5973814 to your computer and use it in GitHub Desktop.
Save ian-kent/5973814 to your computer and use it in GitHub Desktop.
use Mojolicious::Lite;
use EV;
use AnyEvent;
hook after_build_tx => sub {
print "AFTER BUILD TX\n";
};
get '/' => sub {
my $self = shift;
my $w;
print "START\n";
Mojo::IOLoop->timer(5 => sub {
$self->render(text => 'Delayed by 5 seconds!');
print "END\n";
});
};
get '/other' => sub {
my $self = shift;
my $w;
print "START OTHER\n";
Mojo::IOLoop->timer(5 => sub {
$self->render(text => 'Delayed by 5 seconds!');
print "END OTHER\n";
});
};
app->start;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment