public class AsyncDispatcher<K,V> extends Object
General principle: Before a listener is called a queue is created for the specific key. In the queue all following events will be enqueued in case the listener isn't finished yet.
Rationale: We get get called with a new event synchronously and then do the async dispatching. This means we need to be careful not to introduce contention in the synchronous listener execution of the cache. Alternatively we could just have add the event to a queue and then do the more complex dispatching logic in a separate thread, however, that means that we would need an additional thread per cache.
public AsyncDispatcher(Executor executor)
cache2k API documentation. Copyright © 2000–2020 headissue GmbH, Munich.