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:BlockingQueueConsumerOpsRetrieves and removes the head of this queue, waiting if necessary until an element becomes available.- Specified by:
takein interfaceBlockingQueueConsumerOps<DatabaseChangeEvent>- Returns:
- the head of this queue
- Throws:
InterruptedException- if interrupted while waiting
-
poll
Description copied from interface:BlockingQueueConsumerOpsRetrieves and removes the head of this queue, waiting up to the specified wait time if necessary for an element to become available.- Specified by:
pollin interfaceBlockingQueueConsumerOps<DatabaseChangeEvent>- Parameters:
timeout- how long to wait before giving up, in units ofunitunit- aTimeUnitdetermining how to interpret thetimeoutparameter- Returns:
- the head of this queue, or
nullif the specified waiting time elapses before an element is available - Throws:
InterruptedException- if interrupted while waiting
-