summary refs log tree commit diff
path: root/eg/simple.pl
blob: ab07c51bc32f2ceffa56f858ad1760a69bbb63d7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/usr/bin/env perl
use strict;
use warnings;

package myworker;
use Moose;
with 'presque::worker';

use YAML::Syck;
sub work {
    my ($self, $job) = @_;
    warn ">>>je suis $$\n";
    warn Dump $job;
    sleep(100);
}

package main;
my $w = myworker->new(
    base_uri   => 'http://localhost:5000',
    queue_name => 'foo',
    fork_dispatcher => 1,
);

$w->start;