public final class BehaviorBroadcaster<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 Broadcaster.onComplete()
method.dispatcher, environment, HOT_SUBSCRIPTION
capacity, downstreamSubscription, NO_CAPACITY, RESERVED_SLOTS, upstreamSubscription
Modifier and Type | Method and Description |
---|---|
static <T> Broadcaster<T> |
create(Dispatcher dispatcher)
Build a Broadcaster, first broadcasting the most recent signal then ready to broadcast values with
Action.onNext(Object) ,
Broadcaster.onError(Throwable) , Broadcaster.onComplete() . |
static <T> Broadcaster<T> |
create(Environment env)
Build a Broadcaster, first broadcasting the most recent signal then ready to broadcast values with
Broadcaster.onNext(Object) ,
Broadcaster.onError(Throwable) , () . |
static <T> Broadcaster<T> |
create(Environment env,
Dispatcher dispatcher)
Build a Broadcaster, first broadcasting the most recent signal then
ready to broadcast values with
(Object) ,
Broadcaster.onError(Throwable) , Broadcaster.onComplete() . |
protected PushSubscription<O> |
createSubscription(org.reactivestreams.Subscriber<? super O> subscriber,
CompletableQueue<O> queue) |
protected void |
doComplete() |
protected void |
doError(Throwable ev) |
static <T> Broadcaster<T> |
first(T value)
Build a Broadcaster, rfirst broadcasting the most recent signal then starting with the passed value,
then ready to broadcast values with
.Broadcaster#onNext(Object) ,
Broadcaster.onError(Throwable) , () . |
static <T> Broadcaster<T> |
first(T value,
Dispatcher dispatcher)
Build a Broadcaster, first broadcasting the most recent signal then starting with the passed value,
then ready to broadcast values with
Action.onNext(Object) ,
Broadcaster.onError(Throwable) , Broadcaster.onComplete() . |
static <T> Broadcaster<T> |
first(T value,
Environment env)
Build a Broadcaster, first broadcasting the most recent signal then starting with the passed value,
then ready to broadcast values with
Broadcaster.onNext(Object) ,
Broadcaster.onError(Throwable) , () . |
static <T> Broadcaster<T> |
first(T value,
Environment env,
Dispatcher dispatcher)
Build a Broadcaster, first broadcasting the most recent signal then starting with the passed value,
then ready to broadcast values with
(Object) ,
Broadcaster.onError(Throwable) , Broadcaster.onComplete() . |
void |
onNext(O ev) |
cancel, capacity, create, createSubscription, doNext, getDispatcher, onComplete, onError, onSubscribe, recycle, requestUpstream, subscribeWithSubscription
accept, addSubscription, broadcastComplete, broadcastError, broadcastNext, cancelSubscription, checkRequest, combine, control, createTrackingSubscription, debug, 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> first(T value)
.Broadcaster#onNext(Object)
,
Broadcaster.onError(Throwable)
, ()
.
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> first(T value, Environment env)
Broadcaster.onNext(Object)
,
Broadcaster.onError(Throwable)
, ()
.
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 static <T> Broadcaster<T> first(T value, Dispatcher dispatcher)
Action.onNext(Object)
,
Broadcaster.onError(Throwable)
, Broadcaster.onComplete()
.
Values broadcasted are directly consumable by subscribing to the returned instance.T
- the type of values passing through the Broadcasterdispatcher
- the Dispatcher
to useBroadcaster
public static <T> Broadcaster<T> first(T value, Environment env, Dispatcher dispatcher)
(Object)
,
Broadcaster.onError(Throwable)
, Broadcaster.onComplete()
.
Values broadcasted are directly consumable by subscribing to the returned instance.T
- the type of values passing through the Streamenv
- the Reactor Environment
to usedispatcher
- the Dispatcher
to useBroadcaster
public static <T> Broadcaster<T> create(Environment env)
Broadcaster.onNext(Object)
,
Broadcaster.onError(Throwable)
, ()
.
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 static <T> Broadcaster<T> create(Dispatcher dispatcher)
Action.onNext(Object)
,
Broadcaster.onError(Throwable)
, Broadcaster.onComplete()
.
Values broadcasted are directly consumable by subscribing to the returned instance.T
- the type of values passing through the Broadcasterdispatcher
- the Dispatcher
to useBroadcaster
public static <T> Broadcaster<T> create(Environment env, Dispatcher dispatcher)
(Object)
,
Broadcaster.onError(Throwable)
, Broadcaster.onComplete()
.
Values broadcasted are directly consumable by subscribing to the returned instance.T
- the type of values passing through the Streamenv
- the Reactor Environment
to usedispatcher
- the Dispatcher
to useBroadcaster
public void onNext(O ev)
onNext
in interface org.reactivestreams.Subscriber<O>
onNext
in class Broadcaster<O>
protected void doComplete()
doComplete
in class Action<O,O>
protected PushSubscription<O> createSubscription(org.reactivestreams.Subscriber<? super O> subscriber, CompletableQueue<O> queue)
createSubscription
in class Broadcaster<O>
Copyright © 2016. All rights reserved.