Class SingleSubscriberPublisher<T>
java.lang.Object
io.micronaut.core.async.publisher.SingleSubscriberPublisher<T>
- Type Parameters:
T
- the type of element signaled.
- All Implemented Interfaces:
Publisher<T>
A
Publisher
that only allows a single Subscriber
.- Since:
- 1.0
- Author:
- Graeme Rocher
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected Optional<Subscriber<? super T>>
protected abstract void
doSubscribe
(Subscriber<? super T> subscriber) Override to implementPublisher.subscribe(Subscriber)
.final void
subscribe
(Subscriber<? super T> subscriber)
-
Field Details
-
EMPTY_SUBSCRIPTION
-
-
Constructor Details
-
SingleSubscriberPublisher
public SingleSubscriberPublisher()
-
-
Method Details
-
subscribe
-
doSubscribe
Override to implementPublisher.subscribe(Subscriber)
.- Parameters:
subscriber
- The subscriber- See Also:
-
currentSubscriber
- Returns:
- Obtain the current subscriber
-