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
A wrapper over a physical connection providing a way to read/write as a
Publisher.-
Nested Class Summary
Nested classes/interfaces inherited from interface io.servicetalk.transport.api.ConnectionInfo
ConnectionInfo.ProtocolNested classes/interfaces inherited from interface io.servicetalk.transport.netty.internal.NettyConnectionContext
NettyConnectionContext.FlushStrategyProvider -
Method Summary
Modifier and TypeMethodDescriptionread()ReturnsPublisherthat emits all items as read from this connection.Writes all elements emitted by the passedPublisheron this connection.write(Publisher<Write> write, Supplier<FlushStrategy> flushStrategySupplier, Supplier<WriteDemandEstimator> demandEstimatorSupplier) Writes all elements emitted by the passedPublisheron this connection.Methods inherited from interface io.servicetalk.concurrent.api.AsyncCloseable
closeAsync, closeAsyncGracefullyMethods inherited from interface io.servicetalk.transport.api.ConnectionContext
parentMethods inherited from interface io.servicetalk.transport.api.ConnectionInfo
connectionId, executionContext, localAddress, protocol, remoteAddress, socketOption, sslConfig, sslSession, toStringMethods inherited from interface io.servicetalk.concurrent.api.ListenableAsyncCloseable
onCloseMethods inherited from interface io.servicetalk.transport.netty.internal.NettyConnectionContext
defaultFlushStrategy, nettyChannel, onClosing, transportError, updateFlushStrategy
-
Method Details
-
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
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, Supplier<FlushStrategy> flushStrategySupplier, 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:
-