NAME

Swarmage::Worker::POE - POE Based Worker Backend

SYNOPSIS

use Swarmage;
Swarmage::Drone->new(
  workers => [
    {
      module => '+MyWorker',
      backend => 'POE',
      config => { ... }
    }
  ]
);

DESCRIPTION

This worker is intended for those tasks that can be done within the same process as the main Swarmage session, using POE. It's really meant to be a quick bridge betwen Swarmage and other POE-based applications, such as Gungho.

Your slave object needs to be able to tell to which session / to which event the task must be routed to. It is expected that your slave object implement these two methos, which return their respective values:

session          # the session ID / alias 
work_begin_state # the name of the event that gets triggered

When you're done with your work, invoke the task's notify() method

$task->notify();

If you have return values, you need to pass it to the notify() method:

$task->notify($val1, \@val2, \%val3);

METHODS

new

work