Skip to content

Instantly share code, notes, and snippets.

@Akron
Created October 25, 2011 20:57
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/1314239 to your computer and use it in GitHub Desktop.
Save Akron/1314239 to your computer and use it in GitHub Desktop.
Tidy up when guests are gone (write cb)
#!/usr/bin/env perl
use Mojolicious::Lite;
get '/' => sub {
my $c = shift;
$c->res->headers->content_length(5);
$c->write(
'Hallo' => 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