ElementT
- The type of elements received and emitted by this processor.public class SimpleUnicastProcessor<ElementT> extends Object implements Processor<ElementT,ElementT>, Subscription
Processor
that receives items form an upstream publisher, stores them in an
internal queue, then serves them to one single downstream subscriber. It does not support
multiple subscriptions.
Implementation note: this class is intended to serve as the common implementation for all secondary publishers exposed by the driver's reactive API, and in particular, for publishers of query metadata objects. Since such publishers are not critical, and usually only publish a handful of items, this implementation favors simplicity over efficiency (in particular, it uses an unbounded linked queue, but in practice there is no risk that this queue could grow uncontrollably).
Constructor and Description |
---|
SimpleUnicastProcessor() |
Modifier and Type | Method and Description |
---|---|
void |
cancel() |
void |
onComplete() |
void |
onError(Throwable error) |
void |
onNext(ElementT value) |
void |
onSubscribe(Subscription s) |
void |
request(long n) |
void |
subscribe(Subscriber<? super ElementT> subscriber) |
public void subscribe(Subscriber<? super ElementT> subscriber)
public void onSubscribe(Subscription s)
onSubscribe
in interface Subscriber<ElementT>
public void onNext(ElementT value)
onNext
in interface Subscriber<ElementT>
public void onError(Throwable error)
onError
in interface Subscriber<ElementT>
public void onComplete()
onComplete
in interface Subscriber<ElementT>
public void request(long n)
request
in interface Subscription
public void cancel()
cancel
in interface Subscription
Copyright © 2017–2019. All rights reserved.