|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface TaskQueue
TaskQueue objects manage access to named queues of task entries. Entries represent curation task requests that have been deferred. The queue supports concurrent non-blocking writers, but controls read access to a single reader possessing a ticket (first come, first serve). After the read, the queue remains locked until released by the reader, after which it is typically purged.
| Method Summary | |
|---|---|
Set<TaskQueueEntry> |
dequeue(String queueName,
long ticket)
Returns the set of task entries from the named queue. |
void |
enqueue(String queueName,
Set<TaskQueueEntry> entrySet)
Queues a set of task entries to a named queue. |
void |
enqueue(String queueName,
TaskQueueEntry entry)
Queues a single entry to a named queue. |
String[] |
queueNames()
Returns list of queue names. |
void |
release(String queueName,
long ticket,
boolean removeEntries)
Releases the lock upon the named queue, deleting it if removeEntries
is set to true. |
| Method Detail |
|---|
String[] queueNames()
void enqueue(String queueName,
TaskQueueEntry entry)
throws IOException
queueName - the name of the queue on which to writeentry - the task entry
IOException
void enqueue(String queueName,
Set<TaskQueueEntry> entrySet)
throws IOException
queueName - the name of the queue on which to writeentrySet - the set of task entries
IOException
Set<TaskQueueEntry> dequeue(String queueName,
long ticket)
throws IOException
release is called. The ticket may be any number, but a
timestamp should guarantee sufficient uniqueness.
queueName - the name of the queue to readticket - a token which must be presented to release the queue
IOException
void release(String queueName,
long ticket,
boolean removeEntries)
removeEntries
is set to true.
queueName - the name of the queue to releaseticket - a token that was presented when queue was dequeued.removeEntries - flag to indicate whether entries may be deleted
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||