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