|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.amazonaws.services.sqs.buffered.ReceiveQueueBuffer
public class ReceiveQueueBuffer
The ReceiveQueueBuffer class is responsible for dequeueing of messages from a single SQS queue. It uses the provided executor to pre-fetch messages from the server and keeps them in a buffer which it uses to satisfy incoming requests. The number of requests pre-fetched and kept in the buffer, as well as the maximum number of threads used to retrieve the messages are configurable.
Synchronization strategy: - Threads must hold the TaskSpawnSyncPoint object monitor to spawn a new task or modify the number of inflight tasks - Threads must hold the monitor of the "futures" list to modify the list - Threads must hold the monitor of the "finishedTasks" list to modify the list - If you need to lock both futures and finishedTasks, lock futures first and finishedTasks second
Method Summary | |
---|---|
void |
clear()
Clears and nacks any pre-fetched messages in this buffer. |
com.amazonaws.services.sqs.buffered.QueueBufferFuture<ReceiveMessageRequest,ReceiveMessageResult> |
receiveMessageAsync(ReceiveMessageRequest rq,
com.amazonaws.services.sqs.buffered.QueueBufferCallback<ReceiveMessageRequest,ReceiveMessageResult> callback)
Submits the request for retrieval of messages from the queue and returns a future that will be signalled when the request is satisfied. |
void |
shutdown()
Prevents spawning of new retrieval batches and waits for all in-flight retrieval batches to finish |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public void shutdown()
public com.amazonaws.services.sqs.buffered.QueueBufferFuture<ReceiveMessageRequest,ReceiveMessageResult> receiveMessageAsync(ReceiveMessageRequest rq, com.amazonaws.services.sqs.buffered.QueueBufferCallback<ReceiveMessageRequest,ReceiveMessageResult> callback)
public void clear()
|
|||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |