public class RestartingQueueItemProvider<Q> extends java.lang.Object implements QueueItemProvider<Q>
| Constructor and Description |
|---|
RestartingQueueItemProvider(long restartDelayMs,
com.google.common.base.Supplier<QueueItemProvider<Q>> quipSupplier) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
hasNext() |
java.util.Iterator<java.util.Collection<Q>> |
iterator()
Generally returns
this. |
java.util.Collection<Q> |
next() |
void |
remove()
A means to delete the message because it is done or should not be processed again.
|
public RestartingQueueItemProvider(long restartDelayMs,
com.google.common.base.Supplier<QueueItemProvider<Q>> quipSupplier)
restartDelayMs - When a received QueueItemProvider ceases producing elements, how long the next call to
next() will block in milliseconds before grabbing a new one from the supplier.quipSupplier - that returns a working QueueItemProvider for each Supplier.get().public java.util.Iterator<java.util.Collection<Q>> iterator()
QueueItemProviderthis. QueueItemProviders are not generally reusable/resettable since the
underlying message source will often not be reversible. Mashing the two interfaces together simplifies
implementations a bit, and also supports any typical Iterable usage.iterator in interface QueueItemProvider<Q>iterator in interface java.lang.Iterable<java.util.Collection<Q>>public boolean hasNext()
hasNext in interface QueueItemProvider<Q>hasNext in interface java.util.Iterator<java.util.Collection<Q>>QueueReader should continue processing messages from this provider.public java.util.Collection<Q> next()
next in interface QueueItemProvider<Q>next in interface java.util.Iterator<java.util.Collection<Q>>null. The reading QueueReader may sleep after receiving an empty batch depending on its
configuration.public void remove()
QueueItemProviderremove in interface QueueItemProvider<Q>remove in interface java.util.Iterator<java.util.Collection<Q>>