Package io.servicetalk.concurrent.api
Class SequentialSingleSubscriberFunction<T>
- java.lang.Object
-
- io.servicetalk.concurrent.api.SequentialSingleSubscriberFunction<T>
-
- Type Parameters:
T- Type of the result of thisSubscriber.
- All Implemented Interfaces:
java.util.function.Function<SingleSource.Subscriber<? super T>,SingleSource.Subscriber<? super T>>
public final class SequentialSingleSubscriberFunction<T> extends java.lang.Object implements java.util.function.Function<SingleSource.Subscriber<? super T>,SingleSource.Subscriber<? super T>>
Allows multipleSingleSource.Subscribers to be sequentially subscribed to aTestSingle. Attempts to subscribe concurrently will throw an exception.
-
-
Constructor Summary
Constructors Constructor Description SequentialSingleSubscriberFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description SingleSource.Subscriber<? super T>apply(SingleSource.Subscriber<? super T> subscriber)booleanisSubscribed()Returnstrueif aSingleSource.Subscriberis currently active (has been subscribed, and not terminated), orfalseotherwise.SingleSource.Subscriber<? super T>subscriber()Returns the most recently subscribedSingleSource.Subscriber.
-
-
-
Method Detail
-
apply
public SingleSource.Subscriber<? super T> apply(SingleSource.Subscriber<? super T> subscriber)
- Specified by:
applyin interfacejava.util.function.Function<SingleSource.Subscriber<? super T>,SingleSource.Subscriber<? super T>>
-
subscriber
@Nullable public SingleSource.Subscriber<? super T> subscriber()
Returns the most recently subscribedSingleSource.Subscriber.- Returns:
- the most recently subscribed
SingleSource.Subscriber.
-
isSubscribed
public boolean isSubscribed()
Returnstrueif aSingleSource.Subscriberis currently active (has been subscribed, and not terminated), orfalseotherwise.- Returns:
trueif aSingleSource.Subscriberis currently active (has been subscribed, and not terminated), orfalseotherwise.
-
-