public final class SerializedBroadcaster<O> extends Broadcaster<O>
Broadcaster
is a subclass of Stream
which exposes methods for publishing values into the pipeline.
It is possible to publish discreet values typed to the generic type of the Stream
as well as error conditions
and the Reactive Streams "complete" signal via the onComplete()
method.dispatcher, environment, HOT_SUBSCRIPTION
capacity, downstreamSubscription, NO_CAPACITY, RESERVED_SLOTS, upstreamSubscription
Modifier and Type | Method and Description |
---|---|
static <T> Broadcaster<T> |
create()
Build a Broadcaster, ready to broadcast values with
.Broadcaster#onNext(Object) ,
Broadcaster.onError(Throwable) , Broadcaster.onComplete() . |
static <T> Broadcaster<T> |
create(Environment env)
Build a Broadcaster, ready to broadcast values, ready to broadcast values with
Broadcaster.onNext(Object) ,
Broadcaster.onError(Throwable) , Broadcaster.onComplete() . |
void |
onComplete() |
void |
onError(Throwable ev) |
void |
onNext(O ev) |
void |
onSubscribe(org.reactivestreams.Subscription subscription) |
cancel, capacity, create, create, createSubscription, createSubscription, doNext, getDispatcher, recycle, requestUpstream, subscribeWithSubscription
accept, addSubscription, broadcastComplete, broadcastError, broadcastNext, cancelSubscription, checkRequest, combine, control, createTrackingSubscription, debug, doComplete, doError, doOnSubscribe, doShutdown, doStart, downstreamSubscription, evaluateCapacity, findOldestUpstream, getCapacity, getSubscription, isPublishing, onOverflowBuffer, requestAll, requestMore, subscribe, toBroadcastCompleteConsumer, toBroadcastErrorConsumer, toBroadcastNextConsumer, toString
adaptiveConsume, adaptiveConsumeOn, after, batchConsume, batchConsumeOn, broadcast, broadcastOn, broadcastTo, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, cache, cast, concatMap, concatWith, consume, consume, consume, consume, consume, consumeLater, consumeOn, consumeOn, consumeOn, count, count, decode, defaultIfEmpty, dematerialize, dispatchOn, dispatchOn, dispatchOn, distinct, distinct, distinctUntilChanged, distinctUntilChanged, elapsed, elementAt, elementAtOrDefault, encode, env, exists, fanIn, filter, filter, finallyDo, flatMap, getEnvironment, getTimer, groupBy, ignoreError, ignoreError, isReactivePull, join, joinWith, keepAlive, last, lift, log, log, map, materialize, merge, mergeWith, nest, next, observe, observeCancel, observeComplete, observeError, observeStart, observeSubscribe, onErrorResumeNext, onErrorResumeNext, onErrorReturn, onErrorReturn, onOverflowBuffer, onOverflowDrop, partition, partition, process, recover, reduce, reduce, repeat, repeat, repeatWhen, requestWhen, retry, retry, retry, retry, retryWhen, sample, sample, sample, sample, sample, sample, sampleFirst, sampleFirst, sampleFirst, sampleFirst, sampleFirst, sampleFirst, scan, scan, skip, skip, skip, skipWhile, skipWhile, sort, sort, sort, sort, split, split, startWith, startWith, startWith, subscribe, subscribeOn, subscribeOn, subscribeOn, switchMap, take, take, take, takeWhile, tap, throttle, throttle, timeout, timeout, timeout, timeout, timestamp, toBlockingQueue, toBlockingQueue, toList, toList, unbounded, when, window, window, window, window, window, window, window, window, window, window, window, zip, zipWith, zipWith
public static <T> Broadcaster<T> create()
.Broadcaster#onNext(Object)
,
Broadcaster.onError(Throwable)
, Broadcaster.onComplete()
.
Values broadcasted are directly consumable by subscribing to the returned instance.
A serialized broadcaster will make sure that even in a multhithreaded scenario, only one thread will be able to broadcast at a time.
The synchronization is non blocking for the publisher, using thread-stealing and first-in-first-served patterns.T
- the type of values passing through the actionAction
public static <T> Broadcaster<T> create(Environment env)
Broadcaster.onNext(Object)
,
Broadcaster.onError(Throwable)
, Broadcaster.onComplete()
.
Values broadcasted are directly consumable by subscribing to the returned instance.
A serialized broadcaster will make sure that even in a multhithreaded scenario, only one thread will be able to broadcast at a time.
The synchronization is non blocking for the publisher, using thread-stealing and first-in-first-served patterns.T
- the type of values passing through the Broadcasterenv
- the Reactor Environment
to useBroadcaster
public void onSubscribe(org.reactivestreams.Subscription subscription)
onSubscribe
in interface org.reactivestreams.Subscriber<O>
onSubscribe
in class Broadcaster<O>
public void onNext(O ev)
onNext
in interface org.reactivestreams.Subscriber<O>
onNext
in class Broadcaster<O>
org.reactivestreams.Subscriber#onNext(Object)}
public void onError(Throwable ev)
onError
in interface org.reactivestreams.Subscriber<O>
onError
in class Broadcaster<O>
org.reactivestreams.Subscriber#onError(Throwable)}
public void onComplete()
onComplete
in interface org.reactivestreams.Subscriber<O>
onComplete
in class Broadcaster<O>
org.reactivestreams.Subscriber#onComplete()}
Copyright © 2016. All rights reserved.