Class SingleSubscriberPublisher<T>
- java.lang.Object
-
- io.micronaut.core.async.publisher.SingleSubscriberPublisher<T>
-
- Type Parameters:
T
- the type of element signaled.
- All Implemented Interfaces:
org.reactivestreams.Publisher<T>
public abstract class SingleSubscriberPublisher<T> extends java.lang.Object implements org.reactivestreams.Publisher<T>
APublisher
that only allows a singleSubscriber
.- Since:
- 1.0
-
-
Field Summary
Fields Modifier and Type Field Description protected static org.reactivestreams.Subscription
EMPTY_SUBSCRIPTION
-
Constructor Summary
Constructors Constructor Description SingleSubscriberPublisher()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected java.util.Optional<org.reactivestreams.Subscriber<? super T>>
currentSubscriber()
protected abstract void
doSubscribe(org.reactivestreams.Subscriber<? super T> subscriber)
Override to implementPublisher.subscribe(Subscriber)
.void
subscribe(org.reactivestreams.Subscriber<? super T> subscriber)
-
-
-
Method Detail
-
subscribe
public final void subscribe(org.reactivestreams.Subscriber<? super T> subscriber)
- Specified by:
subscribe
in interfaceorg.reactivestreams.Publisher<T>
-
doSubscribe
protected abstract void doSubscribe(org.reactivestreams.Subscriber<? super T> subscriber)
Override to implementPublisher.subscribe(Subscriber)
.- Parameters:
subscriber
- The subscriber- See Also:
Publisher.subscribe(Subscriber)
-
currentSubscriber
protected java.util.Optional<org.reactivestreams.Subscriber<? super T>> currentSubscriber()
- Returns:
- Obtain the current subscriber
-
-