From de8d333b8806b4a1ea0a997f6a916d127eadae4b Mon Sep 17 00:00:00 2001 From: franck cuny Date: Sat, 15 May 2010 14:28:42 +0200 Subject: a simple worker; a role for the REST interface to presque; reg signals to shutdown workers; log before starting a task; fork dispatcher (a la resque) --- eg/simple.pl | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 eg/simple.pl (limited to 'eg/simple.pl') diff --git a/eg/simple.pl b/eg/simple.pl new file mode 100644 index 0000000..ab07c51 --- /dev/null +++ b/eg/simple.pl @@ -0,0 +1,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; -- cgit 1.4.1