T - the things to publishpublic class SingleSubscriberPublisher<T>
extends java.lang.Object
implements org.reactivestreams.Publisher<T>
| Modifier and Type | Class and Description |
|---|---|
static interface |
SingleSubscriberPublisher.OnSubscriptionCallback
This is called when a subscription is made to the publisher
|
| Constructor and Description |
|---|
SingleSubscriberPublisher()
Constructs a publisher with no callback when subscribed
|
SingleSubscriberPublisher(SingleSubscriberPublisher.OnSubscriptionCallback subscriptionCallback)
The producing code can provide a callback to know when the subscriber attaches
|
| Modifier and Type | Method and Description |
|---|---|
void |
noMoreData()
Called by the producing code to say there is no more data to offer and the stream
is complete
|
void |
offer(T data)
Called from the producing code to offer data up ready for a subscriber to read it
|
void |
offerError(java.lang.Throwable t) |
void |
subscribe(org.reactivestreams.Subscriber<? super T> subscriber) |
public SingleSubscriberPublisher()
public SingleSubscriberPublisher(SingleSubscriberPublisher.OnSubscriptionCallback subscriptionCallback)
subscriptionCallback - the callback when some onespublic void offer(T data)
data - the data to offerpublic void noMoreData()
public void offerError(java.lang.Throwable t)