public abstract class ChannelStream<IN,OUT> extends reactor.rx.Stream<IN> implements Channel<IN,OUT>
Channel implementation that handles the basic interaction and behave as a Stream.Channel.ConsumerSpec| Modifier and Type | Field and Description |
|---|---|
protected reactor.rx.broadcast.Broadcaster<IN> |
contentStream |
protected org.slf4j.Logger |
log |
protected PeerStream<IN,OUT,ChannelStream<IN,OUT>> |
peer |
| Modifier | Constructor and Description |
|---|---|
protected |
ChannelStream(reactor.Environment env,
reactor.io.codec.Codec<reactor.io.buffer.Buffer,IN,OUT> codec,
long prefetch,
PeerStream<IN,OUT,ChannelStream<IN,OUT>> peer,
reactor.core.Dispatcher ioDispatcher,
reactor.core.Dispatcher eventsDispatcher) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
cascadeErrorToPeer(java.lang.Throwable t) |
<DECODED> reactor.rx.Stream<DECODED> |
decode(reactor.io.codec.Codec<IN,DECODED,?> codec)
Convert the current stream data into the decoded type produced by the passed codec
|
abstract java.lang.Object |
delegate() |
protected void |
doDecoded(IN in) |
protected abstract void |
flush()
Subclasses must implement this method to perform IO flushes.
|
long |
getCapacity() |
reactor.fn.Function<reactor.io.buffer.Buffer,IN> |
getDecoder() |
reactor.core.Dispatcher |
getDispatcher() |
reactor.fn.Function<OUT,reactor.io.buffer.Buffer> |
getEncoder() |
reactor.Environment |
getEnvironment() |
reactor.core.Dispatcher |
getIODispatcher() |
org.reactivestreams.Subscriber<IN> |
in()
Direct access to receiving side - should be used to forward incoming data manually or testing purpose
|
void |
registerOnPeer()
notify Peer subscribers the channel has been created and attach the Peer defined writer Publishers
|
void |
sink(org.reactivestreams.Publisher<? extends OUT> source)
Send data to the peer, listen for any error on write and close on terminal signal (complete|error).
|
void |
sinkBuffers(org.reactivestreams.Publisher<? extends reactor.io.buffer.Buffer> source) |
void |
subscribe(org.reactivestreams.Subscriber<? super IN> s) |
protected void |
write(reactor.io.buffer.Buffer data,
org.reactivestreams.Subscriber<?> onComplete,
boolean flush)
Subclasses must implement this method to perform the actual IO of writing data to the connection.
|
protected abstract void |
write(java.nio.ByteBuffer data,
org.reactivestreams.Subscriber<?> onComplete,
boolean flush)
Subclasses must implement this method to perform the actual IO of writing data to the connection.
|
protected abstract void |
write(java.lang.Object data,
org.reactivestreams.Subscriber<?> onComplete,
boolean flush)
Subclasses must implement this method to perform the actual IO of writing data to the connection.
|
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, 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, zipWithclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waiton, remoteAddressprotected final org.slf4j.Logger log
protected final PeerStream<IN,OUT,ChannelStream<IN,OUT>> peer
protected final reactor.rx.broadcast.Broadcaster<IN> contentStream
protected ChannelStream(@Nonnull
reactor.Environment env,
@Nullable
reactor.io.codec.Codec<reactor.io.buffer.Buffer,IN,OUT> codec,
long prefetch,
@Nonnull
PeerStream<IN,OUT,ChannelStream<IN,OUT>> peer,
@Nonnull
reactor.core.Dispatcher ioDispatcher,
@Nonnull
reactor.core.Dispatcher eventsDispatcher)
public void subscribe(org.reactivestreams.Subscriber<? super IN> s)
subscribe in interface org.reactivestreams.Publisher<IN>public final void sink(org.reactivestreams.Publisher<? extends OUT> source)
Channelpublic final void sinkBuffers(org.reactivestreams.Publisher<? extends reactor.io.buffer.Buffer> source)
public final reactor.Environment getEnvironment()
getEnvironment in class reactor.rx.Stream<IN>public final reactor.core.Dispatcher getDispatcher()
getDispatcher in class reactor.rx.Stream<IN>public final long getCapacity()
getCapacity in interface reactor.rx.action.support.NonBlockinggetCapacity in class reactor.rx.Stream<IN>public final reactor.core.Dispatcher getIODispatcher()
public final reactor.fn.Function<reactor.io.buffer.Buffer,IN> getDecoder()
public final reactor.fn.Function<OUT,reactor.io.buffer.Buffer> getEncoder()
public final org.reactivestreams.Subscriber<IN> in()
public final <DECODED> reactor.rx.Stream<DECODED> decode(reactor.io.codec.Codec<IN,DECODED,?> codec)
public abstract java.lang.Object delegate()
public void registerOnPeer()
protected final void cascadeErrorToPeer(java.lang.Throwable t)
protected void doDecoded(IN in)
protected void write(reactor.io.buffer.Buffer data,
org.reactivestreams.Subscriber<?> onComplete,
boolean flush)
data - The data to write, as a Buffer.onComplete - The callback to invoke when the write is complete.protected abstract void write(java.nio.ByteBuffer data,
org.reactivestreams.Subscriber<?> onComplete,
boolean flush)
data - The data to write.onComplete - The callback to invoke when the write is complete.flush - whether to flush the underlying IO channelprotected abstract void write(java.lang.Object data,
org.reactivestreams.Subscriber<?> onComplete,
boolean flush)
data - The data to write.onComplete - The callback to invoke when the write is complete.flush - whether to flush the underlying IO channelprotected abstract void flush()