public interface NetChannel<IN,OUT>
NetChannel implementations handle interacting with the client.| Modifier and Type | Interface and Description |
|---|---|
static interface |
NetChannel.ConsumerSpec
Spec class for assigning multiple event handlers on a channel.
|
| Modifier and Type | Method and Description |
|---|---|
reactor.core.composable.Promise<java.lang.Boolean> |
close()
Close this NetChannel.
|
void |
close(reactor.function.Consumer<java.lang.Boolean> onClose)
Close this
NetChannel and invoke the given Consumer when closed. |
NetChannel<IN,OUT> |
consume(reactor.function.Consumer<IN> consumer)
Efficiently consume incoming decoded data.
|
reactor.core.composable.Stream<IN> |
in()
Stream of incoming decoded data. |
NetChannel.ConsumerSpec |
on()
Assign event handlers to certain channel lifecycle events.
|
reactor.function.batch.BatchConsumer<OUT> |
out()
BatchConsumer for efficiently data to the peer. |
NetChannel<IN,OUT> |
receive(reactor.function.Function<IN,OUT> fn)
Handle incoming data and return the response.
|
java.net.InetSocketAddress |
remoteAddress()
Get the address of the remote peer.
|
reactor.core.composable.Promise<java.lang.Void> |
send(OUT data)
Send data to the peer.
|
NetChannel<IN,OUT> |
send(reactor.core.composable.Stream<OUT> data)
Send data to the peer that passes through the given
Stream. |
NetChannel<IN,OUT> |
sendAndForget(OUT data)
Send data to the peer.
|
reactor.core.composable.Promise<IN> |
sendAndReceive(OUT data)
Send data to the peer and expect a response.
|
<T extends java.lang.Throwable> |
when(java.lang.Class<T> type,
reactor.function.Consumer<T> onError)
When an error of the given type occurs, handle it with the given
Consumer. |
java.net.InetSocketAddress remoteAddress()
reactor.core.composable.Stream<IN> in()
Stream of incoming decoded data.Streamreactor.function.batch.BatchConsumer<OUT> out()
BatchConsumer for efficiently data to the peer.BatchConsumer<T extends java.lang.Throwable> NetChannel<IN,OUT> when(java.lang.Class<T> type, reactor.function.Consumer<T> onError)
Consumer.T - type of the exceptiontype - type of erroronError - error handlerNetChannel<IN,OUT> consume(reactor.function.Consumer<IN> consumer)
consumer - the incoming data ConsumerNetChannel<IN,OUT> receive(reactor.function.Function<IN,OUT> fn)
fn - request handlerNetChannel<IN,OUT> send(reactor.core.composable.Stream<OUT> data)
Stream.data - the Stream of data to monitorreactor.core.composable.Promise<java.lang.Void> send(OUT data)
data - the data to sendPromise indicating when the send operation has completedNetChannel<IN,OUT> sendAndForget(OUT data)
data - the data to sendreactor.core.composable.Promise<IN> sendAndReceive(OUT data)
data - the data to sendPromise representing the response from the peerreactor.core.composable.Promise<java.lang.Boolean> close()
void close(reactor.function.Consumer<java.lang.Boolean> onClose)
NetChannel and invoke the given Consumer when closed.onClose - NetChannel.ConsumerSpec on()