The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Stub::StubWorker - Helios::Worker subclass to handle [job type here] jobs

DESCRIPTION

This is a stub class to use as a guide to create new job types for the Helios system (ie new Helios::Worker subclasses).

TheSchwartz METHODS

The following methods are actually class methods that will be called by TheSchwartz job queue. By overriding them, you define how your jobs will run in the system and what actions will be performed.

The max_retries() and retry_delay() methods determines how many times a job is to be retried if it fails, and the amount of time to wait before the job is to be retried (in seconds). If you want your jobs to be retried twice (for 3 total run attempts) and to wait at least an hour before they are reattempted, you would define max_retries() and retry_delay() thusly:

 sub max_retries { return 2; }
 sub retry_delay { return 3600; }

TheSchwartz default is to not retry, with no retry delay, so if that's what you want, comment out the following sub definitions.

work()

The work() method is called as a class method. It does the typical prep work for a Helios worker, parses the arguments for the job object it was passed, does the necessary work, and then marks the job as succeeded or failed.

Since most of the Helios::Worker methods are actually instance methods, instantiating an object of the class work() was passed will take care of that for you.

SEE ALSO

Helios::Worker, helios.pl, TheSchwartz