public interface SignalOffloader
SignalOffloader instance MUST only be used for a single asynchronous execution chain at
any given time. Reusing it across different execution chains concurrently may result in deadlock.
Concurrent invocation of any SignalOffloader methods may result in deadlock.| 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. |
<T> PublisherSource.Subscriber<? super T> offloadSubscriber(PublisherSource.Subscriber<? super T> subscriber)
PublisherSource.Subscriber such that all method calls to it will be offloaded.
SignalOffloader instance.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.<T> SingleSource.Subscriber<? super T> offloadSubscriber(SingleSource.Subscriber<? super T> subscriber)
SingleSource.Subscriber such that all method calls to it will be offloaded.
SignalOffloader instance.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.CompletableSource.Subscriber offloadSubscriber(CompletableSource.Subscriber subscriber)
CompletableSource.Subscriber such that all method calls to it will be offloaded.
SignalOffloader instance.subscriber - CompletableSource.Subscriber for which the signals are to be offloaded.CompletableSource.Subscriber that will offload signals to the passed
CompletableSource.Subscriber.<T> PublisherSource.Subscriber<? super T> offloadSubscription(PublisherSource.Subscriber<? super T> subscriber)
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.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.<T> SingleSource.Subscriber<? super T> offloadCancellable(SingleSource.Subscriber<? super T> subscriber)
SingleSource.Subscriber such that all method calls to its Cancellable will
be offloaded.
None of the SingleSource.Subscriber methods will be offloaded.
SignalOffloader instance.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.CompletableSource.Subscriber offloadCancellable(CompletableSource.Subscriber subscriber)
CompletableSource.Subscriber such that all method calls to its Cancellable
will be offloaded.
None of the CompletableSource.Subscriber methods will be offloaded.
SignalOffloader instance.subscriber - CompletableSource.Subscriber for which the signals are to be offloaded.CompletableSource.Subscriber that will offload signals to the passed
CompletableSource.Subscriber.<T> void offloadSubscribe(PublisherSource.Subscriber<? super T> subscriber, java.util.function.Consumer<PublisherSource.Subscriber<? super T>> handleSubscribe)
PublisherSource.Subscriber.
PublisherSource.Subscriber will be
correctly terminated.
SignalOffloader instance.T - Type of signal.subscriber - PublisherSource.Subscriber for which subscribe call has to be offloaded.handleSubscribe - Consumer to handle the offloaded subscribe call.<T> void offloadSubscribe(SingleSource.Subscriber<? super T> subscriber, java.util.function.Consumer<SingleSource.Subscriber<? super T>> handleSubscribe)
PublisherSource.Subscriber.
PublisherSource.Subscriber will be
correctly terminated.
SignalOffloader instance.T - Type of signal.subscriber - SingleSource.Subscriber for which subscribe call has to be offloaded.handleSubscribe - Consumer to handle the offloaded subscribe call.void offloadSubscribe(CompletableSource.Subscriber subscriber, java.util.function.Consumer<CompletableSource.Subscriber> handleSubscribe)
PublisherSource.Subscriber.
PublisherSource.Subscriber will be
correctly terminated.
SignalOffloader instance.subscriber - PublisherSource.Subscriber for which for which subscribe call has to be offloaded.handleSubscribe - Consumer to handle the offloaded subscribe call.<T> void offloadSignal(T signal,
java.util.function.Consumer<T> signalConsumer)
signal by the passed Consumer.
SignalOffloader instance.T - Type of signal.signal - signal to send to the Consumer.signalConsumer - Consumer of the signal.