public interface ReactorChannel<IN,OUT>
extends org.reactivestreams.Publisher<IN>
Channel
is a virtual connection that often matches with a Socket or a Channel (e.g. Netty).
Implementations handle interacting inbound (received data) and errors by subscribing to it.
Writing and "flushing" is controlled by sinking 1 or more writeWith(Publisher)
that will forward data to outbound.
When a drained Publisher completes or error, the channel will automatically "flush" its pending writes.Modifier and Type | Interface and Description |
---|---|
static interface |
ReactorChannel.ConsumerSpec
Spec class for assigning multiple event handlers on a channel.
|
Modifier and Type | Method and Description |
---|---|
ReactorChannel.ConsumerSpec |
on()
Assign event handlers to certain channel lifecycle events.
|
InetSocketAddress |
remoteAddress()
Get the address of the remote peer.
|
org.reactivestreams.Publisher<Void> |
writeWith(org.reactivestreams.Publisher<? extends OUT> dataStream)
Send data to the peer, listen for any error on write and close on terminal signal (complete|error).
|
InetSocketAddress remoteAddress()
org.reactivestreams.Publisher<Void> writeWith(org.reactivestreams.Publisher<? extends OUT> dataStream)
dataStream
- the dataStream publishing OUT items to write on this channelReactorChannel.ConsumerSpec on()
Copyright © 2016. All rights reserved.