abstract class Openclerk\Jobs \ JobQueuer

All known direct subclasses:
MissingAverageJobQueuer,OpenclerkJobQueuer

A helper class to find job instances that need to be run, and queue them up in the database. Job running is managed by JobRunner.

TODO create more intelligent job queueing strategies


Method Summary

Name Description
findJobs(Connection $db, Logger $logger) Get a list of all jobs that need to be queued, as an array of associative arrays with (job_type, arg_id, [user_id]).
getJobPrefix($job_type)
jobQueued(Connection $db, Logger $logger, $job) The given job has been queued up, so we can mark it as successfully queued.
queue(Connection $db, Logger $logger) Find all jobs that need to be queued through #findJobs() and queue them up in the database.

abstract function findJobs(Connection $db, Logger $logger)

Get a list of all jobs that need to be queued, as an array of associative arrays with (job_type, arg_id, [user_id]).

This could use e.g. JobTypeFinder


static function getJobPrefix($job_type)


abstract function jobQueued(Connection $db, Logger $logger, $job)

The given job has been queued up, so we can mark it as successfully queued.


public function queue(Connection $db, Logger $logger)

Find all jobs that need to be queued through #findJobs() and queue them up in the database.

Throws:
Exception - if the job failed