Package io.servicetalk.concurrent.api
Interface ReplayAccumulator<T>
- Type Parameters:
T
- The type of data to accumulate.
public interface ReplayAccumulator<T>
Accumulates signals for the
Publisher
replay operator.-
Method Summary
Modifier and TypeMethodDescriptionvoid
accumulate
(T t) Called on eachPublisherSource.Subscriber.onNext(Object)
and intended to accumulate the signal so that newPublisherSource.Subscriber
s will see this value viadeliverAccumulation(Consumer)
.default void
Called if the accumulation can be cancelled and any asynchronous resources can be cleaned up (e.g.void
deliverAccumulation
(Consumer<T> consumer) Called to deliver the signals fromaccumulate(Object)
to newconsumer
.
-
Method Details
-
accumulate
Called on eachPublisherSource.Subscriber.onNext(Object)
and intended to accumulate the signal so that newPublisherSource.Subscriber
s will see this value viadeliverAccumulation(Consumer)
.This method won't be called concurrently, but should return quickly to minimize performance impacts.
- Parameters:
t
- AnPublisherSource.Subscriber.onNext(Object)
to accumulate.
-
deliverAccumulation
Called to deliver the signals fromaccumulate(Object)
to newconsumer
.- Parameters:
consumer
- The consumer of the signals previously aggregated viaaccumulate(Object)
.
-
cancelAccumulation
default void cancelAccumulation()Called if the accumulation can be cancelled and any asynchronous resources can be cleaned up (e.g. timers).
-