Koha::BackgroundJob - Koha BackgroundJob Object class
This is a base class for BackgroundJob, some methods must be subclassed.
Example of usage:
Producer: my $job_id = Koha::BackgroundJob->enqueue( { job_type => $job_type, job_size => $job_size, job_args => $job_args } );
Consumer: Koha::BackgrounJobs->find($job_id)->process; See also misc/background_jobs_worker.pl
for a full example
Connect to the message broker using default guest/guest credential
Enqueue a new job. It will insert a new row in the DB table and notify the broker that a new job has been enqueued.
job_size
is the size of the job job_args
is the arguments of the job.
It's a structure that will be JSON encoded.
Return the job_id of the newly created job.
Process the job!
Return the job type of the job. Must be a string.
Messages let during the processing of the job.
Report of the job.
Cancel a job.