NAME
Stub::StubService - 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::Service subclasses).
RETRY METHODS
Define max_retries() and retry_delay() methods to determine how many times a job should be retried if it fails and what the interval between the retries should be. If you don't define these methods, jobs for your service class will not be retried if they fail.
The following declarations set a job to be retried twice at 1 hour intervals.
run($job)
The run() method is the method called to actually run a job. It is called as an object method, and will be passed a Helios::Job object representing the job arguments and other information associated with the job to be run.
Once the work for a particular job is done, you should mark the job as either completed, failed, or permanently failed. You can do this by calling the completedJob(), failedJob(), and failedJobPermanent() methods. These methods will call the appropriate Helios::Job methods to mark the job as completed.
Helios expects your service class's run() method to return 0 if the job succeeded or a nonzero if it failed. If your calls to completedJob() or failedJob() are the last statements made in your run() method, those methods will return the proper codes for you, so it is suggested that they always be the last calls you make in run().