Interface QueueingSegmentListener<K,V,E extends Event<K,V>>
- All Superinterfaces:
io.reactivex.rxjava3.functions.Function<SegmentPublisherSupplier.Notification<CacheEntry<K,
V>>, org.reactivestreams.Publisher<CacheEntry<K, V>>>
public interface QueueingSegmentListener<K,V,E extends Event<K,V>>
extends io.reactivex.rxjava3.functions.Function<SegmentPublisherSupplier.Notification<CacheEntry<K,V>>,org.reactivestreams.Publisher<CacheEntry<K,V>>>
This interface describes methods needed for a segment listener that is used when iterating over the current
events and be able to queue them properly
- Since:
- 7.0
- Author:
- wburns
-
Field Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.reactivestreams.Publisher
<CacheEntry<K, V>> apply
(SegmentPublisherSupplier.Notification<CacheEntry<K, V>> cacheEntryNotification) This should be invoked on a notification before actually processing the data.boolean
handleEvent
(EventWrapper<K, V, E> wrapper, ListenerInvocation<Event<K, V>> invocation) This should be called by any listener when an event is generated to possibly queue it.This is needed to tell the handler when the complete iteration is done.
-
Field Details
-
NOTIFIED
-
REMOVED
-
-
Method Details
-
apply
org.reactivestreams.Publisher<CacheEntry<K,V>> apply(SegmentPublisherSupplier.Notification<CacheEntry<K, V>> cacheEntryNotification) throws ThrowableThis should be invoked on a notification before actually processing the data. Note this method modifies the underlying listener state. It will return a Publisher with the entries that need to be notified or an empty Publisher if none -
handleEvent
This should be called by any listener when an event is generated to possibly queue it. If it is not queued, then the caller should take appropriate action such as manually firing the invocation.- Parameters:
wrapper
- The event that was just raisedinvocation
- The invocation the event would be fired on- Returns:
- Whether or not it was queued. If it wasn't queued the invocation should be fired manually
-
transferComplete
CompletionStage<Void> transferComplete()This is needed to tell the handler when the complete iteration is done. Depending on the implementation this could also fire all queued events that are remaining.
-