public abstract class PeerStream<IN,OUT,CONN extends ChannelStream<IN,OUT>>
extends reactor.rx.Stream<CONN>
| Modifier and Type | Field and Description |
|---|---|
protected reactor.rx.broadcast.Broadcaster<CONN> |
channels |
protected long |
prefetch |
| Modifier | Constructor and Description |
|---|---|
protected |
PeerStream(reactor.Environment env,
reactor.core.Dispatcher dispatcher,
reactor.io.codec.Codec<reactor.io.buffer.Buffer,IN,OUT> codec) |
protected |
PeerStream(reactor.Environment env,
reactor.core.Dispatcher dispatcher,
reactor.io.codec.Codec<reactor.io.buffer.Buffer,IN,OUT> codec,
long prefetch) |
| Modifier and Type | Method and Description |
|---|---|
protected org.reactivestreams.Publisher<? extends OUT> |
addWritePublisher(org.reactivestreams.Publisher<? extends OUT> publisher)
Implementing Write consumers for errors, batch requesting/flushing, write requests
The routeChannel method will resolve the current channel consumers to execute and listen for returning signals.
|
protected abstract CONN |
bindChannel(java.lang.Object nativeChannel,
long prefetch)
Subclasses should implement this method and provide a
ChannelStream object. |
protected reactor.fn.Consumer<java.lang.Void> |
completeConsumer(CONN ch) |
protected reactor.fn.Function<reactor.rx.Stream<java.lang.Long>,? extends org.reactivestreams.Publisher<? extends java.lang.Long>> |
createAdaptiveDemandMapper(CONN ch,
reactor.fn.Consumer<java.lang.Throwable> errorConsumer) |
protected reactor.rx.action.Action<java.lang.Long,java.lang.Long> |
createBatchAction(CONN ch,
reactor.fn.Consumer<java.lang.Throwable> errorConsumer,
reactor.fn.Consumer<java.lang.Void> completionConsumer) |
protected reactor.fn.Consumer<java.lang.Throwable> |
createErrorConsumer(ChannelStream<IN,OUT> ch) |
protected void |
doPipeline(reactor.fn.Function<? super CONN,? extends org.reactivestreams.Publisher<? extends OUT>> serviceFunction) |
reactor.io.codec.Codec<reactor.io.buffer.Buffer,IN,OUT> |
getDefaultCodec()
Get the
Codec in use. |
reactor.core.Dispatcher |
getDispatcher() |
reactor.Environment |
getEnvironment() |
long |
getPrefetchSize() |
protected void |
mergeWrite(CONN ch) |
protected void |
notifyError(java.lang.Throwable t)
Notify this server's consumers that the server has errors.
|
protected void |
notifyNewChannel(CONN channel)
Notify this peer's consumers that the channel has been opened.
|
protected void |
notifyShutdown()
Notify this server's consumers that the server has stopped.
|
protected java.lang.Iterable<org.reactivestreams.Publisher<? extends OUT>> |
routeChannel(CONN ch) |
void |
subscribe(org.reactivestreams.Subscriber<? super CONN> s) |
protected void |
subscribeChannelHandlers(reactor.rx.Stream<? extends OUT> writeStream,
CONN ch) |
adaptiveConsume, adaptiveConsumeOn, batchConsume, batchConsumeOn, broadcast, broadcastOn, broadcastTo, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, buffer, cache, capacity, cast, cleanSubscriptionReference, combine, concatMap, concatWith, consume, consume, consume, consume, consume, consumeLater, consumeOn, consumeOn, consumeOn, count, count, defaultIfEmpty, dematerialize, dispatchOn, dispatchOn, dispatchOn, distinct, distinct, distinctUntilChanged, distinctUntilChanged, downstreamSubscription, elapsed, elementAt, elementAtOrDefault, env, exists, fanIn, filter, filter, finallyDo, flatMap, getCapacity, getTimer, groupBy, ignoreErrors, ignoreErrors, isReactivePull, join, joinWith, keepAlive, last, lift, log, log, map, materialize, merge, mergeWith, nest, next, notify, notify, observe, observeCancel, observeComplete, observeError, observeSubscribe, onErrorResumeNext, onErrorResumeNext, onErrorReturn, onErrorReturn, onOverflowBuffer, onOverflowBuffer, onOverflowDrop, partition, partition, 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, takeWhile, tap, throttle, throttle, timeout, timeout, timeout, timeout, timestamp, toBlockingQueue, toBlockingQueue, toList, toList, toString, when, window, window, window, window, window, window, window, window, window, window, window, zip, zipWith, zipWithprotected final reactor.rx.broadcast.Broadcaster<CONN extends ChannelStream<IN,OUT>> channels
protected final long prefetch
protected PeerStream(reactor.Environment env,
reactor.core.Dispatcher dispatcher,
reactor.io.codec.Codec<reactor.io.buffer.Buffer,IN,OUT> codec)
public void subscribe(org.reactivestreams.Subscriber<? super CONN> s)
protected void doPipeline(reactor.fn.Function<? super CONN,? extends org.reactivestreams.Publisher<? extends OUT>> serviceFunction)
public final reactor.core.Dispatcher getDispatcher()
getDispatcher in class reactor.rx.Stream<CONN extends ChannelStream<IN,OUT>>protected final void notifyError(java.lang.Throwable t)
t - the error to signalprotected final void notifyNewChannel(CONN channel)
channel - The channel that was opened.protected final void notifyShutdown()
protected final org.reactivestreams.Publisher<? extends OUT> addWritePublisher(org.reactivestreams.Publisher<? extends OUT> publisher)
protected abstract CONN bindChannel(java.lang.Object nativeChannel, long prefetch)
ChannelStream object.protected reactor.fn.Consumer<java.lang.Throwable> createErrorConsumer(ChannelStream<IN,OUT> ch)
protected reactor.rx.action.Action<java.lang.Long,java.lang.Long> createBatchAction(CONN ch, reactor.fn.Consumer<java.lang.Throwable> errorConsumer, reactor.fn.Consumer<java.lang.Void> completionConsumer)
protected reactor.fn.Function<reactor.rx.Stream<java.lang.Long>,? extends org.reactivestreams.Publisher<? extends java.lang.Long>> createAdaptiveDemandMapper(CONN ch, reactor.fn.Consumer<java.lang.Throwable> errorConsumer)
protected java.lang.Iterable<org.reactivestreams.Publisher<? extends OUT>> routeChannel(CONN ch)
protected void mergeWrite(CONN ch)
protected reactor.fn.Consumer<java.lang.Void> completeConsumer(CONN ch)
protected void subscribeChannelHandlers(reactor.rx.Stream<? extends OUT> writeStream, CONN ch)
@Nullable public final reactor.io.codec.Codec<reactor.io.buffer.Buffer,IN,OUT> getDefaultCodec()
Codec in use.@Nonnull public final reactor.Environment getEnvironment()
getEnvironment in class reactor.rx.Stream<CONN extends ChannelStream<IN,OUT>>public final long getPrefetchSize()