Class DatabaseChangeConsumerOps
java.lang.Object
com.couchbase.client.dcp.highlevel.internal.DatabaseChangeConsumerOps
- All Implemented Interfaces:
BlockingQueueConsumerOps<DatabaseChangeEvent>
public class DatabaseChangeConsumerOps
extends Object
implements BlockingQueueConsumerOps<DatabaseChangeEvent>
Optionally auto-acknowledges events as they are consumed.
-
Constructor Summary
ConstructorsConstructorDescriptionDatabaseChangeConsumerOps
(BlockingQueue<DatabaseChangeEvent> queue, FlowControlMode flowControlMode) -
Method Summary
Modifier and TypeMethodDescriptionRetrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.take()
Retrieves and removes the head of this queue, waiting if necessary until an element becomes available.
-
Constructor Details
-
DatabaseChangeConsumerOps
public DatabaseChangeConsumerOps(BlockingQueue<DatabaseChangeEvent> queue, FlowControlMode flowControlMode)
-
-
Method Details
-
take
Description copied from interface:BlockingQueueConsumerOps
Retrieves and removes the head of this queue, waiting if necessary until an element becomes available.- Specified by:
take
in interfaceBlockingQueueConsumerOps<DatabaseChangeEvent>
- Returns:
- the head of this queue
- Throws:
InterruptedException
- if interrupted while waiting
-
poll
Description copied from interface:BlockingQueueConsumerOps
Retrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.- Specified by:
poll
in interfaceBlockingQueueConsumerOps<DatabaseChangeEvent>
- Parameters:
timeout
- how long to wait before giving up, in units ofunit
unit
- aTimeUnit
determining how to interpret thetimeout
parameter- Returns:
- the head of this queue, or
null
if the specified waiting time elapses before an element is available - Throws:
InterruptedException
- if interrupted while waiting
-