public interface SubscriberManagement<T> extends ResizableMultiReaderRingBuffer.Cursors
Modifier and Type | Interface and Description |
---|---|
static class |
SubscriberManagement.Completed$ |
static interface |
SubscriberManagement.EndOfStream |
static class |
SubscriberManagement.ErrorCompleted |
static class |
SubscriberManagement.ErrorCompleted$ |
static class |
SubscriberManagement.NotReached$ |
Modifier and Type | Method and Description |
---|---|
void |
abortDownstream(java.lang.Throwable cause)
this method must be called by the implementing class to push an error downstream
|
void |
addSubscription(org.reactivestreams.Subscriber<? super T> subscriber) |
java.lang.String |
bufferDebug() |
void |
cancelUpstream()
called before
shutdown() if the stream is *not* being regularly completed
but shut-down due to the last subscriber having canceled its subscription |
void |
completeDownstream()
this method must be called by the implementing class whenever
it has been determined that no more elements will be produced
|
SubscriptionWithCursor |
createSubscription(org.reactivestreams.Subscriber<? super T> subscriber)
Use to register a subscriber
|
scala.collection.immutable.List<SubscriptionWithCursor> |
cursors() |
int |
initialBufferSize() |
int |
maxBufferSize() |
void |
moreRequested(SubscriptionWithCursor subscription,
long elements)
more demand was signaled from a given subscriber
|
void |
pushToDownstream(T value)
this method must be called by the implementing class whenever a new value is available to be pushed downstream
|
void |
registerSubscriber(org.reactivestreams.Subscriber<? super T> subscriber)
Register a new subscriber.
|
void |
requestFromUpstream(long elements)
called when we are ready to consume more elements from our upstream
MUST NOT call pushToDownstream
|
void |
requestFromUpstreamIfRequired() |
void |
shutdown(boolean completed)
called when the spi.Publisher/Processor is ready to be shut down
|
void |
unregisterSubscription(SubscriptionWithCursor subscription)
called from
Subscription::cancel , i.e. |
void |
unregisterSubscriptionInternal(SubscriptionWithCursor subscription) |
int initialBufferSize()
int maxBufferSize()
void requestFromUpstream(long elements)
elements
- (undocumented)void cancelUpstream()
shutdown()
if the stream is *not* being regularly completed
but shut-down due to the last subscriber having canceled its subscriptionvoid shutdown(boolean completed)
completed
- (undocumented)SubscriptionWithCursor createSubscription(org.reactivestreams.Subscriber<? super T> subscriber)
subscriber
- (undocumented)java.lang.String bufferDebug()
scala.collection.immutable.List<SubscriptionWithCursor> cursors()
cursors
in interface ResizableMultiReaderRingBuffer.Cursors
void moreRequested(SubscriptionWithCursor subscription, long elements)
subscription
- (undocumented)elements
- (undocumented)void requestFromUpstreamIfRequired()
void pushToDownstream(T value)
value
- (undocumented)void completeDownstream()
void abortDownstream(java.lang.Throwable cause)
cause
- (undocumented)void registerSubscriber(org.reactivestreams.Subscriber<? super T> subscriber)
subscriber
- (undocumented)void addSubscription(org.reactivestreams.Subscriber<? super T> subscriber)
void unregisterSubscription(SubscriptionWithCursor subscription)
Subscription::cancel
, i.e. from another thread,
override to add synchronization with itself, subscribe
and moreRequested
subscription
- (undocumented)void unregisterSubscriptionInternal(SubscriptionWithCursor subscription)