NAME
Job::Machine::Worker - Base class for Job Workers
DESCRIPTION
Inherits from Job::Machine::Base.
All you have to do to write a worker for a particular Job Class is
use base 'Job::Machine::Worker';
sub process {
my ($self, $data) = @_;
... do stuff
};
METHODS
reply
$worker->reply($some_structure);
Reply to a message. Use from within a Worker's process method.
receive
$worker->receive;
Starts the Worker's receive loop.
process
Subclassable process method.
E.g.
sub process {
my ($self, $data) = @_;
... process $data
$self->reply({answer => 'Something'});
};
SEE ALSO
AUTHOR
Kaare Rasmussen <kaare@cpan.org>.
COPYRIGHT
Copyright (C) 2009, Kaare Rasmussen
This module is free software; you can redistribute it or modify it under the same terms as Perl itself.