#include <OTC/dispatch/jobqueue.hh> class OTC_JobQueue {
public:
virtual ~OTC_JobQueue();
void add(OTC_Job* theJob);
virtual OTC_Job* next();
};
OTC_JobQueue
holds jobs on behalf of the dispatcher. The default
implementation of the job queue adds new jobs to the end of the
queue and returns jobs from the front of the queue.
If you need to redefine the scheduling algorithm, you should
derive your own queue from this class and redefine next()
.
An example of a derived queue would be one that, before returning
a job from the queue, would check to see if any signals had
occurred that agents were interested in. Signals would be given a
higher priority than jobs already queued, so a new job
corresponding to the signal would be created and returned, instead
of getting the job from the front of the queue. The same queue
could also use the system select()
or poll()
function to
generate new jobs corresponding to I/O or timer events.
virtual ~OTC_JobQueue();
void add(OTC_Job* theJob);
theJob
is 0
.
virtual OTC_Job* next();
OTC_Dispatcher
, OTC_Job