Skip to content

Instantly share code, notes, and snippets.

@Akron
Created October 5, 2011 20:09
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 Akron/1265535 to your computer and use it in GitHub Desktop.
Save Akron/1265535 to your computer and use it in GitHub Desktop.
Tidy up when guests are gone
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => sub {
my $c = shift;
$c->render_text('Hallo!');
$c->on_finish(
sub {
my $c = shift;
sleep(3);
$c->app->log->debug('finished');
});
};
app->start;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment