Package org.cache2k.core.event
Class AsyncDispatcher<K>
- java.lang.Object
-
- org.cache2k.core.event.AsyncDispatcher<K>
-
public class AsyncDispatcher<K> extends Object
Dispatch events via the executor. Executes in parallel or serializes them, if for the identical key.- Author:
- Jens Wilke
-
-
Constructor Summary
Constructors Constructor Description AsyncDispatcher(InternalCache<?,?> cache, Executor executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidqueue(AsyncEvent<K> event)Immediately executes an event with the provided executor.voidrunMoreOrStop(AsyncEvent<K> event)Run as long there is still an event for the key.
-
-
-
Constructor Detail
-
AsyncDispatcher
public AsyncDispatcher(InternalCache<?,?> cache, Executor executor)
-
-
Method Detail
-
queue
public void queue(AsyncEvent<K> event)
Immediately executes an event with the provided executor. If an event is already executing for the identical key, queue the event and execute the event with FIFO scheme, preserving the order of the arrival.
-
runMoreOrStop
public void runMoreOrStop(AsyncEvent<K> event)
Run as long there is still an event for the key.
-
-