Hey Randy,
Actually, the qb::requestwork is completely optional. For job types such as the command line job type ("cmdline") they just execute the command and exit.
Example:
#execute my command
system($job->{"package"}->{"command"});
#return failed status if something goes wrong
if ($totallyWrong) {
qb::reportjob("failed");
exit(1);
}
#if everything is ok, fall through.
1;
If you have several commands or require the system to keep track of a list of parameters, then we recommend you use the agenda.
There are principally 3 functions involved with reporting information to and from the supervisor from the job:
qb::requestwork - gets the next avaliable agenda item.
<$work object> = qb::requestwork();
qb::reportwork - reports the status of the agenda item.
qb::reportwork(<$work object>);
qb::reportjob - reports the status of the subjob itself.
qb::reportjob(<$job status>);
The job status can be any one of the following states:
pending
blocked
complete
failed
killed
The use of requestwork/reportwork is only necessary if you plan on having the system keep track of a list of things to do. If not, it's not important to call them.
A.