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.Subscriber
s 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)
boolean
isSubscribed()
Returnstrue
if aSingleSource.Subscriber
is currently active (has been subscribed, and not terminated), orfalse
otherwise.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:
apply
in 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()
Returnstrue
if aSingleSource.Subscriber
is currently active (has been subscribed, and not terminated), orfalse
otherwise.- Returns:
true
if aSingleSource.Subscriber
is currently active (has been subscribed, and not terminated), orfalse
otherwise.
-
-