![]() |
Public API Reference |
![]() |
Interface to simple job management system. More...
#include <iutil/job.h>
Public Types | |
enum | JobStatus { NotEnqueued, Pending, Dequeued } |
Status values for Dequeue and PullAndRun. More... | |
Public Member Functions | |
virtual JobStatus | Dequeue (iJob *job, bool waitForCompletion=false)=0 |
Remove a job from the queue. | |
virtual void | Enqueue (iJob *job)=0 |
Add a job to the queue. | |
virtual int32 | GetQueueCount ()=0 |
Return the number of jobs in the queue. | |
virtual bool | IsFinished ()=0 |
Return true if all enqueued jobs are finished. | |
virtual JobStatus | PullAndRun (iJob *job, bool waitForCompletion=true)=0 |
Check if a job is still in the queue and, if so, remove it from the queue and run it immediately. | |
virtual void | WaitAll ()=0 |
Wait for all jobs in queue to finish executing. |
Interface to simple job management system.
The queue will execute the jobs according to the policy of the implementation, such as in parallel using multiple threads.
enum iJobQueue::JobStatus |
Status values for Dequeue and PullAndRun.
NotEnqueued |
The job was not enqueued. |
Pending |
The job is currently running. |
Dequeued |
The job was pulled from a queue and executed (PullAndRun()) resp. dropped (PullAndDrop()) |
virtual JobStatus iJobQueue::Dequeue | ( | iJob * | job, |
bool | waitForCompletion = false |
||
) | [pure virtual] |
Remove a job from the queue.
If the job is currently running, this will wait for it to finish if waitForCompletion is true
, otherwise nothing is done.
Pending
). Wait for job completion if this is not desired. virtual void iJobQueue::Enqueue | ( | iJob * | job | ) | [pure virtual] |
Add a job to the queue.
virtual int32 iJobQueue::GetQueueCount | ( | ) | [pure virtual] |
Return the number of jobs in the queue.
virtual bool iJobQueue::IsFinished | ( | ) | [pure virtual] |
Return true if all enqueued jobs are finished.
virtual JobStatus iJobQueue::PullAndRun | ( | iJob * | job, |
bool | waitForCompletion = true |
||
) | [pure virtual] |
Check if a job is still in the queue and, if so, remove it from the queue and run it immediately.
If a job is currently running, either wait for it (waitForCompletion is true
) to finish or just let it be.
Pending
). Wait for job completion if this is not desired. virtual void iJobQueue::WaitAll | ( | ) | [pure virtual] |
Wait for all jobs in queue to finish executing.