public interface QueuePersistor<T>
extends java.lang.Iterable<T>
PersistentQueue.
Persistence could be achieved through in-memory solutions like a Map or could be more complex and
use a backing datastore.| Modifier and Type | Method and Description |
|---|---|
void |
close()
Release any internal resources used by the persistence mechanism.
|
Function<java.lang.Long,T> |
get()
Returns a
Function that will return the item with the given id. |
boolean |
hasNext()
Are there more items waiting to be returned?
|
long |
lastId()
Get the value of the last item to have been persisted.
|
Function<T,java.lang.Long> |
offer()
Returns a
Function that will persist the item and return a Long id for the item. |
Supplier<T> |
remove()
Returns a
Supplier that will simply remove the oldest item from the persistence queue. |
long |
size()
Get the number of items persisted right now.
|
long lastId()
long size()
boolean hasNext()
true if items can be retrieved from this persistor, false otherwise@Nonnull Function<T,java.lang.Long> offer()
Function that will persist the item and return a Long id for the item.@Nonnull Function<java.lang.Long,T> get()
Function that will return the item with the given id.@Nonnull Supplier<T> remove()
Supplier that will simply remove the oldest item from the persistence queue.void close()