T
- The type of Publisher
.public final class SpScPublisherProcessor<T> extends SubscribablePublisher<T>
Publisher
that allows for signals to be directly injected via sendOnNext(Object)
,
sendOnComplete()
, and sendOnError(Throwable)
. The threading restrictions for this class are:
sendOnNext(Object)
, sendOnComplete()
, and sendOnError(Throwable)
methods.PublisherSource.Subscriber
is
supported. Other operators can be used to add support for multiple PublisherSource.Subscriber
s if necessary.
PublisherSource.Subscriber<T>, PublisherSource.Subscription
Constructor and Description |
---|
SpScPublisherProcessor(int maxOnNextQueueSize)
Create a new instance.
|
Modifier and Type | Method and Description |
---|---|
protected void |
handleSubscribe(PublisherSource.Subscriber<? super T> s)
Handles a subscriber to this
Publisher . |
void |
sendOnComplete()
Send an
PublisherSource.Subscriber#onComplete() signal to the subscriber of this Publisher . |
void |
sendOnError(java.lang.Throwable t)
Send an
PublisherSource.Subscriber#onError(Throwable) signal to the subscriber of this Publisher . |
void |
sendOnNext(T t)
Send an
PublisherSource.Subscriber#onNext(Object) signal to the subscriber of this Publisher . |
subscribe
afterCancel, afterFinally, afterOnComplete, afterOnError, afterOnNext, afterOnSubscribe, afterRequest, afterSubscriber, afterSubscription, beforeCancel, beforeFinally, beforeOnComplete, beforeOnError, beforeOnNext, beforeOnSubscribe, beforeRequest, beforeSubscriber, beforeSubscription, collect, concat, concat, concat, defer, empty, failed, filter, firstOrElse, firstOrError, flatMapCompletable, flatMapCompletable, flatMapCompletableDelayError, flatMapCompletableDelayError, flatMapConcatIterable, flatMapMergeSingle, flatMapMergeSingle, flatMapMergeSingleDelayError, flatMapMergeSingleDelayError, forEach, from, from, fromBlockingIterable, fromInputStream, fromIterable, groupBy, groupBy, groupToMany, groupToMany, idleTimeout, idleTimeout, idleTimeout, idleTimeout, ignoreElements, liftAsync, liftSync, liftSyncToSingle, map, multicastToExactly, multicastToExactly, never, publishAndSubscribeOn, publishAndSubscribeOnOverride, publishOn, publishOnOverride, recoverWith, repeat, repeatWhen, retry, retryWhen, subscribeInternal, subscribeOn, subscribeOnOverride, subscribeShareContext, takeAtMost, takeUntil, takeWhile, toCompletionStage, toCompletionStage, toFuture, toFuture, toInputStream, toInputStream, toIterable, toIterable, whenCancel, whenFinally, whenOnComplete, whenOnError, whenOnNext, whenOnSubscribe, whenRequest, whenSubscriber, whenSubscription
public SpScPublisherProcessor(int maxOnNextQueueSize)
maxOnNextQueueSize
- The maximum amount of PublisherSource.Subscriber#onNext(Object)
signals that
can be queued from sendOnNext(Object)
.protected void handleSubscribe(PublisherSource.Subscriber<? super T> s)
Publisher
Publisher
.handleSubscribe
in class Publisher<T>
s
- the subscriber.public void sendOnNext(@Nullable T t)
PublisherSource.Subscriber#onNext(Object)
signal to the subscriber of this Publisher
.t
- The signals for PublisherSource.Subscriber#onNext(Object)
.QueueFullException
- if the queue of signals would exceed the maximum size.public void sendOnError(java.lang.Throwable t)
PublisherSource.Subscriber#onError(Throwable)
signal to the subscriber of this Publisher
.t
- The signals for PublisherSource.Subscriber#onError(Throwable)
.public void sendOnComplete()
PublisherSource.Subscriber#onComplete()
signal to the subscriber of this Publisher
.