Interface NettyConnection<Read,Write>
-
- Type Parameters:
Read- Type of objects read from this connection.Write- Type of objects written to this connection.
- All Superinterfaces:
AsyncCloseable,ConnectionContext,ConnectionInfo,ListenableAsyncCloseable,NettyConnectionContext
- All Known Implementing Classes:
DefaultNettyConnection
public interface NettyConnection<Read,Write> extends NettyConnectionContext
A wrapper over a physical connection providing a way to read/write as aPublisher.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface io.servicetalk.transport.api.ConnectionInfo
ConnectionInfo.Protocol
-
Nested classes/interfaces inherited from interface io.servicetalk.transport.netty.internal.NettyConnectionContext
NettyConnectionContext.FlushStrategyProvider
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Publisher<Read>read()ReturnsPublisherthat emits all items as read from this connection.Completablewrite(Publisher<Write> write)Writes all elements emitted by the passedPublisheron this connection.Completablewrite(Publisher<Write> write, java.util.function.Supplier<FlushStrategy> flushStrategySupplier, java.util.function.Supplier<WriteDemandEstimator> demandEstimatorSupplier)Writes all elements emitted by the passedPublisheron this connection.-
Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsync, closeAsyncGracefully
-
Methods inherited from interface io.servicetalk.transport.api.ConnectionInfo
executionContext, localAddress, protocol, remoteAddress, socketOption, sslSession
-
Methods inherited from interface io.servicetalk.concurrent.api.ListenableAsyncCloseable
onClose
-
Methods inherited from interface io.servicetalk.transport.netty.internal.NettyConnectionContext
defaultFlushStrategy, nettyChannel, onClosing, transportError, updateFlushStrategy
-
-
-
-
Method Detail
-
read
Publisher<Read> read()
ReturnsPublisherthat emits all items as read from this connection.- Returns:
Publisherthat emits all items as read from this connection. Concurrent subscribes when aPublisherSource.Subscriberis already active) are disallowed but sequential subscribes when a previousPublisherSource.Subscriberhas terminated) are allowed.
-
write
Completable write(Publisher<Write> write)
Writes all elements emitted by the passedPublisheron this connection.- Parameters:
write-Publisher, all objects emitted from which are written on this connection.- Returns:
Completablethat terminates as follows:
-
write
Completable write(Publisher<Write> write, java.util.function.Supplier<FlushStrategy> flushStrategySupplier, java.util.function.Supplier<WriteDemandEstimator> demandEstimatorSupplier)
Writes all elements emitted by the passedPublisheron this connection.- Parameters:
write-Publisher, all objects emitted from which are written on this connection.flushStrategySupplier-SupplierofFlushStrategywhich controls the flush operations for this write.demandEstimatorSupplier- ASupplierofWriteDemandEstimatorfor this write.- Returns:
Completablethat terminates as follows:
-
-