public abstract class AsyncIOProcessor<Item>
extends java.lang.Object
put(Object, Consumer)
method since it will
hijack a worker if nobody else is currently processing queued items. If the internal queue has reached it's capacity incoming threads
might be blocked until other items are processedModifier | Constructor and Description |
---|---|
protected |
AsyncIOProcessor(org.apache.logging.log4j.Logger logger,
int queueSize) |
Modifier and Type | Method and Description |
---|---|
void |
put(Item item,
java.util.function.Consumer<java.lang.Exception> listener)
Adds the given item to the queue.
|
protected abstract void |
write(java.util.List<Tuple<Item,java.util.function.Consumer<java.lang.Exception>>> candidates)
Writes or processes the items out or to disk.
|
protected AsyncIOProcessor(org.apache.logging.log4j.Logger logger, int queueSize)
public final void put(Item item, java.util.function.Consumer<java.lang.Exception> listener)