Type | Name and description |
---|---|
def |
WorkQueue(com.android.utils.ILogger logger, QueueThreadContext<T> queueThreadContext, String queueName, int workforce, int growthTriggerRatio) Creates a new queue, with a number of dedicated threads to process the queue's jobs. |
String |
getName() Return a human readable queue name, mainly used for identification purposes. |
void |
push(Job<T> job) |
void |
run() each thread in the mWorkThreads will run this single infinite processing loop until a death action is received. |
void |
shutdown() Shutdowns the working queue and wait until all pending requests have been processed. |
int |
size() Returns the number of jobs waiting to be scheduled. |
Creates a new queue, with a number of dedicated threads to process the queue's jobs.
logger
- to log messagesqueueName
- a meaningful descriptive name.workforce
- the number of dedicated threads for this queue.growthTriggerRatio
- the ratio between outstanding requests and worker threads that
should trigger a growth in worker threads.Return a human readable queue name, mainly used for identification purposes.
each thread in the mWorkThreads will run this single infinite processing loop until a death action is received.
Shutdowns the working queue and wait until all pending requests have been processed. This needs to be reviewed as jobs can still be added to the queue once the shutdown process has started....
Returns the number of jobs waiting to be scheduled.