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.Subscribers 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)booleanisSubscribed()Returnstrueif aPublisherSource.Subscriberis currently active (has been subscribed, and not terminated), orfalseotherwise.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:
applyin 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()
Returnstrueif aPublisherSource.Subscriberis currently active (has been subscribed, and not terminated), orfalseotherwise.- Returns:
trueif aPublisherSource.Subscriberis currently active (has been subscribed, and not terminated), orfalseotherwise.
-
-