public class DelegatingSignalOffloader extends java.lang.Object implements SignalOffloader
SignalOffloader
that delegates all calls to another SignalOffloader
.Constructor and Description |
---|
DelegatingSignalOffloader(SignalOffloader delegate)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
CompletableSource.Subscriber |
offloadCancellable(CompletableSource.Subscriber subscriber)
Decorates the passed
CompletableSource.Subscriber such that all method calls to its Cancellable
will be offloaded. |
<T> SingleSource.Subscriber<? super T> |
offloadCancellable(SingleSource.Subscriber<? super T> subscriber)
Decorates the passed
SingleSource.Subscriber such that all method calls to its Cancellable will
be offloaded. |
<T> void |
offloadSignal(T signal,
java.util.function.Consumer<T> signalConsumer)
Offloads the consumption of the passed
signal by the passed Consumer . |
void |
offloadSubscribe(CompletableSource.Subscriber subscriber,
java.util.function.Consumer<CompletableSource.Subscriber> handleSubscribe)
Offloads the subscribe call for the passed
PublisherSource.Subscriber . |
<T> void |
offloadSubscribe(PublisherSource.Subscriber<? super T> subscriber,
java.util.function.Consumer<PublisherSource.Subscriber<? super T>> handleSubscribe)
Offloads subscribe call for the passed
PublisherSource.Subscriber . |
<T> void |
offloadSubscribe(SingleSource.Subscriber<? super T> subscriber,
java.util.function.Consumer<SingleSource.Subscriber<? super T>> handleSubscribe)
Offloads subscribe call for the passed
PublisherSource.Subscriber . |
CompletableSource.Subscriber |
offloadSubscriber(CompletableSource.Subscriber subscriber)
Decorates the passed
CompletableSource.Subscriber such that all method calls to it will be offloaded. |
<T> PublisherSource.Subscriber<? super T> |
offloadSubscriber(PublisherSource.Subscriber<? super T> subscriber)
Decorates the passed
PublisherSource.Subscriber such that all method calls to it will be offloaded. |
<T> SingleSource.Subscriber<? super T> |
offloadSubscriber(SingleSource.Subscriber<? super T> subscriber)
Decorates the passed
SingleSource.Subscriber such that all method calls to it will be offloaded. |
<T> PublisherSource.Subscriber<? super T> |
offloadSubscription(PublisherSource.Subscriber<? super T> subscriber)
Decorates the passed
PublisherSource.Subscriber such that all method calls to its PublisherSource.Subscription will be offloaded. |
public DelegatingSignalOffloader(SignalOffloader delegate)
delegate
- SignalOffloader
to delegate all calls.public <T> PublisherSource.Subscriber<? super T> offloadSubscriber(PublisherSource.Subscriber<? super T> subscriber)
SignalOffloader
PublisherSource.Subscriber
such that all method calls to it will be offloaded.
SignalOffloader
instance.offloadSubscriber
in interface SignalOffloader
T
- Type of items received by the passed and returned PublisherSource.Subscriber
.subscriber
- PublisherSource.Subscriber
for which the signals are to be offloaded.PublisherSource.Subscriber
that will offload signals to the passed PublisherSource.Subscriber
.public <T> SingleSource.Subscriber<? super T> offloadSubscriber(SingleSource.Subscriber<? super T> subscriber)
SignalOffloader
SingleSource.Subscriber
such that all method calls to it will be offloaded.
SignalOffloader
instance.offloadSubscriber
in interface SignalOffloader
T
- Type of items received by the passed and returned SingleSource.Subscriber
.subscriber
- SingleSource.Subscriber
for which the signals are to be offloaded.SingleSource.Subscriber
that will offload signals to the passed
SingleSource.Subscriber
.public CompletableSource.Subscriber offloadSubscriber(CompletableSource.Subscriber subscriber)
SignalOffloader
CompletableSource.Subscriber
such that all method calls to it will be offloaded.
SignalOffloader
instance.offloadSubscriber
in interface SignalOffloader
subscriber
- CompletableSource.Subscriber
for which the signals are to be offloaded.CompletableSource.Subscriber
that will offload signals to the passed
CompletableSource.Subscriber
.public <T> PublisherSource.Subscriber<? super T> offloadSubscription(PublisherSource.Subscriber<? super T> subscriber)
SignalOffloader
PublisherSource.Subscriber
such that all method calls to its PublisherSource.Subscription
will be offloaded.
None of the PublisherSource.Subscriber
methods will be offloaded.
SignalOffloader
instance.offloadSubscription
in interface SignalOffloader
T
- Type of items received by the passed and returned PublisherSource.Subscriber
.subscriber
- PublisherSource.Subscriber
for which the signals are to be offloaded.PublisherSource.Subscriber
that will offload signals to the passed PublisherSource.Subscriber
.public <T> SingleSource.Subscriber<? super T> offloadCancellable(SingleSource.Subscriber<? super T> subscriber)
SignalOffloader
SingleSource.Subscriber
such that all method calls to its Cancellable
will
be offloaded.
None of the SingleSource.Subscriber
methods will be offloaded.
SignalOffloader
instance.offloadCancellable
in interface SignalOffloader
T
- Type of items received by the passed and returned SingleSource.Subscriber
.subscriber
- SingleSource.Subscriber
for which the signals are to be offloaded.SingleSource.Subscriber
that will offload signals to the passed
SingleSource.Subscriber
.public CompletableSource.Subscriber offloadCancellable(CompletableSource.Subscriber subscriber)
SignalOffloader
CompletableSource.Subscriber
such that all method calls to its Cancellable
will be offloaded.
None of the CompletableSource.Subscriber
methods will be offloaded.
SignalOffloader
instance.offloadCancellable
in interface SignalOffloader
subscriber
- CompletableSource.Subscriber
for which the signals are to be offloaded.CompletableSource.Subscriber
that will offload signals to the passed
CompletableSource.Subscriber
.public <T> void offloadSubscribe(PublisherSource.Subscriber<? super T> subscriber, java.util.function.Consumer<PublisherSource.Subscriber<? super T>> handleSubscribe)
SignalOffloader
PublisherSource.Subscriber
.
PublisherSource.Subscriber
will be
correctly terminated.
SignalOffloader
instance.offloadSubscribe
in interface SignalOffloader
T
- Type of signal.subscriber
- PublisherSource.Subscriber
for which subscribe call has to be offloaded.handleSubscribe
- Consumer
to handle the offloaded subscribe call.public <T> void offloadSubscribe(SingleSource.Subscriber<? super T> subscriber, java.util.function.Consumer<SingleSource.Subscriber<? super T>> handleSubscribe)
SignalOffloader
PublisherSource.Subscriber
.
PublisherSource.Subscriber
will be
correctly terminated.
SignalOffloader
instance.offloadSubscribe
in interface SignalOffloader
T
- Type of signal.subscriber
- SingleSource.Subscriber
for which subscribe call has to be offloaded.handleSubscribe
- Consumer
to handle the offloaded subscribe call.public void offloadSubscribe(CompletableSource.Subscriber subscriber, java.util.function.Consumer<CompletableSource.Subscriber> handleSubscribe)
SignalOffloader
PublisherSource.Subscriber
.
PublisherSource.Subscriber
will be
correctly terminated.
SignalOffloader
instance.offloadSubscribe
in interface SignalOffloader
subscriber
- PublisherSource.Subscriber
for which for which subscribe call has to be offloaded.handleSubscribe
- Consumer
to handle the offloaded subscribe call.public <T> void offloadSignal(T signal, java.util.function.Consumer<T> signalConsumer)
SignalOffloader
signal
by the passed Consumer
.
SignalOffloader
instance.offloadSignal
in interface SignalOffloader
T
- Type of signal.signal
- signal
to send to the Consumer
.signalConsumer
- Consumer
of the signal.