public interface NettyOutbound extends Publisher<java.lang.Void>
| Modifier and Type | Field and Description |
|---|---|
static FileChunkedStrategy<io.netty.buffer.ByteBuf> |
FILE_CHUNKED_STRATEGY_BUFFER |
| Modifier and Type | Method and Description |
|---|---|
default io.netty.buffer.ByteBufAllocator |
alloc()
Return the assigned
ByteBufAllocator. |
NettyContext |
context()
Return a
NettyContext to operate on the underlying
Channel state. |
default NettyOutbound |
context(java.util.function.Consumer<NettyContext> contextCallback)
Immediately call the passed callback with a
NettyContext to operate on the
underlying
Channel state. |
default FileChunkedStrategy<?> |
getFileChunkedStrategy() |
default reactor.core.publisher.Mono<java.lang.Void> |
neverComplete()
Return a never completing
Mono after this then() has
completed. |
default NettyOutbound |
onWriteIdle(long idleTimeout,
java.lang.Runnable onWriteIdle)
Assign a
Runnable to be invoked when writes have become idle for the given
timeout. |
default NettyOutbound |
options(java.util.function.Consumer<? super NettyPipeline.SendOptions> configurator)
Provide a new
NettyOutbound scoped configuration for sending. |
default NettyOutbound |
send(Publisher<? extends io.netty.buffer.ByteBuf> dataStream)
Send data to the peer, listen for any error on write and close on terminal signal
(complete|error).
|
default NettyOutbound |
sendByteArray(Publisher<? extends byte[]> dataStream)
Send bytes to the peer, listen for any error on write and close on terminal
signal (complete|error).
|
default NettyOutbound |
sendFile(java.nio.file.Path file)
Send content from given
Path using
FileChannel.transferTo(long, long, WritableByteChannel)
support. |
default NettyOutbound |
sendFile(java.nio.file.Path file,
long position,
long count)
Send content from given
Path using
FileChannel.transferTo(long, long, WritableByteChannel)
support. |
default NettyOutbound |
sendFileChunked(java.nio.file.Path file,
long position,
long count)
Note: Nesting any send* method is not supported.
|
default NettyOutbound |
sendGroups(Publisher<? extends Publisher<? extends io.netty.buffer.ByteBuf>> dataStreams)
Send data to the peer, listen for any error on write and close on terminal signal
(complete|error).Each individual
Publisher completion will flush
the underlying IO runtime. |
default NettyOutbound |
sendObject(java.lang.Object msg)
Send data to the peer, listen for any error on write and close on terminal signal
(complete|error).
|
default NettyOutbound |
sendObject(Publisher<?> dataStream)
Send Object to the peer, listen for any error on write and close on terminal signal
(complete|error).
|
default NettyOutbound |
sendString(Publisher<? extends java.lang.String> dataStream)
Send String to the peer, listen for any error on write and close on terminal signal
(complete|error).
|
default NettyOutbound |
sendString(Publisher<? extends java.lang.String> dataStream,
java.nio.charset.Charset charset)
Send String to the peer, listen for any error on write and close on terminal signal
(complete|error).
|
default void |
subscribe(Subscriber<? super java.lang.Void> s)
Subscribe a
Void subscriber to this outbound and trigger all eventual
parent outbound send. |
default reactor.core.publisher.Mono<java.lang.Void> |
then()
Obtain a
Mono of pending outbound(s) write completion. |
default NettyOutbound |
then(Publisher<java.lang.Void> other)
Append a
Publisher task such as a Mono and return a new
NettyOutbound to sequence further send. |
static final FileChunkedStrategy<io.netty.buffer.ByteBuf> FILE_CHUNKED_STRATEGY_BUFFER
default io.netty.buffer.ByteBufAllocator alloc()
ByteBufAllocator.ByteBufAllocatorNettyContext context()
NettyContext to operate on the underlying
Channel state.NettyContextdefault NettyOutbound context(java.util.function.Consumer<NettyContext> contextCallback)
NettyContext to operate on the
underlying
Channel state. This allows for chaining outbound API.contextCallback - context callbackNettyContextdefault FileChunkedStrategy<?> getFileChunkedStrategy()
default reactor.core.publisher.Mono<java.lang.Void> neverComplete()
Mono after this then() has
completed.Mono after this then() has
completed.default NettyOutbound onWriteIdle(long idleTimeout, java.lang.Runnable onWriteIdle)
Runnable to be invoked when writes have become idle for the given
timeout. This replaces any previously set idle callback.idleTimeout - the idle timeoutonWriteIdle - the idle timeout handlerdefault NettyOutbound options(java.util.function.Consumer<? super NettyPipeline.SendOptions> configurator)
NettyOutbound scoped configuration for sending. The
NettyPipeline.SendOptions changes will apply to the next written object or
Publisher.configurator - the callback invoked to retrieve send configurationthis instancedefault NettyOutbound send(Publisher<? extends io.netty.buffer.ByteBuf> dataStream)
A new NettyOutbound type (or the same) for typed send
sequences. An implementor can therefore specialize the Outbound after a first after
a prepending data publisher.
Note: Nesting any send* method is not supported.
dataStream - the dataStream publishing OUT items to write on this channelNettyOutbound to append further send. It will emit a complete
signal successful sequence write (e.g. after "flush") or any error during write.default NettyOutbound sendByteArray(Publisher<? extends byte[]> dataStream)
dataStream - the dataStream publishing Buffer items to write on this channeldefault NettyOutbound sendFile(java.nio.file.Path file)
Path using
FileChannel.transferTo(long, long, WritableByteChannel)
support. If the system supports it and the path resolves to a local file
system File then transfer will use zero-byte copy
to the peer.
It will listen for any error on write and close on terminal signal (complete|error). If more than one publisher is attached (multiple calls to send()) completion occurs after all publishers complete.
Note: this will emit FileRegion in the outbound
ChannelPipeline
Note: Nesting any send* method is not supported.
file - the file Pathdefault NettyOutbound sendFile(java.nio.file.Path file, long position, long count)
Path using
FileChannel.transferTo(long, long, WritableByteChannel)
support. If the system supports it and the path resolves to a local file
system File then transfer will use zero-byte copy
to the peer.
It will listen for any error on write and close on terminal signal (complete|error). If more than one publisher is attached (multiple calls to send()) completion occurs after all publishers complete.
Note: this will emit FileRegion in the outbound
ChannelPipeline
Note: Nesting any send* method is not supported.
file - the file Pathposition - where to startcount - how much to transferdefault NettyOutbound sendFileChunked(java.nio.file.Path file, long position, long count)
file - the file Pathposition - where to startcount - how much to transferdefault NettyOutbound sendGroups(Publisher<? extends Publisher<? extends io.netty.buffer.ByteBuf>> dataStreams)
Publisher completion will flush
the underlying IO runtime.
Note: Nesting any send* method is not supported.dataStreams - the dataStream publishing OUT items to write on this channelMono to signal successful sequence write (e.g. after "flush") or
any error during writedefault NettyOutbound sendObject(Publisher<?> dataStream)
dataStream - the dataStream publishing Buffer items to write on this channeldefault NettyOutbound sendObject(java.lang.Object msg)
msg - the object to publishMono to signal successful sequence write (e.g. after "flush") or
any error during writedefault NettyOutbound sendString(Publisher<? extends java.lang.String> dataStream)
dataStream - the dataStream publishing Buffer items to write on this channeldefault NettyOutbound sendString(Publisher<? extends java.lang.String> dataStream, java.nio.charset.Charset charset)
dataStream - the dataStream publishing Buffer items to write on this channelcharset - the encoding charsetdefault void subscribe(Subscriber<? super java.lang.Void> s)
Void subscriber to this outbound and trigger all eventual
parent outbound send.subscribe in interface Publisher<java.lang.Void>s - the Subscriber to listen for send sequence completion/failuredefault reactor.core.publisher.Mono<java.lang.Void> then()
Mono of pending outbound(s) write completion.Mono of pending outbound(s) write completiondefault NettyOutbound then(Publisher<java.lang.Void> other)
Publisher task such as a Mono and return a new
NettyOutbound to sequence further send.other - the Publisher to subscribe to when this pending outbound
then() is complete;NettyOutbound that