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()
ReturnsPublisher
that emits all items as read from this connection.Completable
write(Publisher<Write> write)
Writes all elements emitted by the passedPublisher
on this connection.Completable
write(Publisher<Write> write, java.util.function.Supplier<FlushStrategy> flushStrategySupplier, java.util.function.Supplier<WriteDemandEstimator> demandEstimatorSupplier)
Writes all elements emitted by the passedPublisher
on 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()
ReturnsPublisher
that emits all items as read from this connection.- Returns:
Publisher
that emits all items as read from this connection. Concurrent subscribes when aPublisherSource.Subscriber
is already active) are disallowed but sequential subscribes when a previousPublisherSource.Subscriber
has terminated) are allowed.
-
write
Completable write(Publisher<Write> write)
Writes all elements emitted by the passedPublisher
on this connection.- Parameters:
write
-Publisher
, all objects emitted from which are written on this connection.- Returns:
Completable
that 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 passedPublisher
on this connection.- Parameters:
write
-Publisher
, all objects emitted from which are written on this connection.flushStrategySupplier
-Supplier
ofFlushStrategy
which controls the flush operations for this write.demandEstimatorSupplier
- ASupplier
ofWriteDemandEstimator
for this write.- Returns:
Completable
that terminates as follows:
-
-