public final class JobQueue extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
addWorker(org.gearman.common.interfaces.Worker worker) |
boolean |
enqueue(QueuedJob runnableJob) |
Collection<QueuedJob> |
getAllJobs() |
HashMap<String,com.google.common.collect.ImmutableList<QueuedJob>> |
getCopyOfJobQueues() |
String |
getName() |
Integer |
getNumberOfConnectedWorkers() |
boolean |
isEmpty() |
String |
metricName() |
QueuedJob |
nextJob() |
void |
notifyWorkers() |
QueuedJob |
poll()
Fetch the next job waiting -- this checks high, then normal, then low
Caveat: in the normal queue, we skip over any jobs whose timestamp has not
come yet (support for epoch jobs)
|
boolean |
remove(QueuedJob queuedJob) |
void |
removeWorker(org.gearman.common.interfaces.Worker worker) |
void |
setMaxQueue(int size) |
void |
setWorkerAsleep(org.gearman.common.interfaces.Worker worker) |
void |
setWorkerAwake(org.gearman.common.interfaces.Worker worker) |
int |
size()
Returns the total number of jobs in this queue
|
boolean |
uniqueIdInUse(String uniqueID) |
public JobQueue(String name)
public final boolean enqueue(QueuedJob runnableJob)
public final QueuedJob poll()
public final int size()
public final boolean uniqueIdInUse(String uniqueID)
public final void setWorkerAsleep(org.gearman.common.interfaces.Worker worker)
public final void setWorkerAwake(org.gearman.common.interfaces.Worker worker)
public final void addWorker(org.gearman.common.interfaces.Worker worker)
public final void removeWorker(org.gearman.common.interfaces.Worker worker)
public final boolean isEmpty()
public final void setMaxQueue(int size)
public void notifyWorkers()
public final String getName()
public final QueuedJob nextJob()
public final boolean remove(QueuedJob queuedJob)
public String metricName()
public Collection<QueuedJob> getAllJobs()
public HashMap<String,com.google.common.collect.ImmutableList<QueuedJob>> getCopyOfJobQueues()
public Integer getNumberOfConnectedWorkers()
Copyright © 2013. All Rights Reserved.