1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
#!/usr/bin/env perl use strict; use warnings; package myworker; use Moose; with 'presque::worker'; use YAML::Syck; sub work { my ($self, $job) = @_; warn Dump $job; sleep(5); } package main; my $w = myworker->new( base_uri => 'http://localhost:5000', queue_name => 'foo', fork_dispatcher => 1, ); $w->start;