Package io.servicetalk.concurrent.api
Class SequentialCompletableSubscriberFunction
- java.lang.Object
-
- io.servicetalk.concurrent.api.SequentialCompletableSubscriberFunction
-
- All Implemented Interfaces:
java.util.function.Function<CompletableSource.Subscriber,CompletableSource.Subscriber>
public final class SequentialCompletableSubscriberFunction extends java.lang.Object implements java.util.function.Function<CompletableSource.Subscriber,CompletableSource.Subscriber>
Allows multipleCompletableSource.Subscriber
s to be sequentially subscribed to aTestCompletable
. Attempts to subscribe concurrently will throw an exception.
-
-
Constructor Summary
Constructors Constructor Description SequentialCompletableSubscriberFunction()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CompletableSource.Subscriber
apply(CompletableSource.Subscriber subscriber)
boolean
isSubscribed()
Returnstrue
if aCompletableSource.Subscriber
is currently active (has been subscribed, and not terminated), orfalse
otherwise.CompletableSource.Subscriber
subscriber()
Returns the most recently subscribedCompletableSource.Subscriber
.
-
-
-
Method Detail
-
apply
public CompletableSource.Subscriber apply(CompletableSource.Subscriber subscriber)
- Specified by:
apply
in interfacejava.util.function.Function<CompletableSource.Subscriber,CompletableSource.Subscriber>
-
subscriber
@Nullable public CompletableSource.Subscriber subscriber()
Returns the most recently subscribedCompletableSource.Subscriber
.- Returns:
- the most recently subscribed
CompletableSource.Subscriber
.
-
isSubscribed
public boolean isSubscribed()
Returnstrue
if aCompletableSource.Subscriber
is currently active (has been subscribed, and not terminated), orfalse
otherwise.- Returns:
true
if aCompletableSource.Subscriber
is currently active (has been subscribed, and not terminated), orfalse
otherwise.
-
-