Last active
June 23, 2016 12:12
-
-
Save avrono/1f42dd0a0be9393bbda1a8d30a4f2269 to your computer and use it in GitHub Desktop.
This file contains 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
app->minion->add_task(poke_mojo => sub { | |
my $job = shift; | |
#$job->app->ua->get('mojolicious.org'); | |
sleep 15; | |
my $log = Mojo::Log->new; | |
$log->debug('We have poked mojolicious.org for a visitor'); | |
}); | |
# Perform job in a background worker process | |
get '/minion' => sub { | |
my $c = shift; | |
$c->minion->enqueue('poke_mojo'); | |
$c->render(text => 'We will poke mojolicious.org for you soon.'); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment