NAME

Swarmage::Worker - Swarmage Worker

SYNOPSIS

# Use it by subclassing
package MyApp::Worker;
use strict;
use base qw(Swarmage::Worker);
__PACKAGE__->abilities('name_of_ability');

sub work_once
{
  my ($self, $task) = @_;
  # do something interesting
}

# Use it by passing a callback

METHODS

new

abilities

Get/Set the abilities for the client

work

Starts the work cycle.

work_once

Does the actual work. The return value will be used as the value to be postback, if postback is specified.

post_work

finalize_work