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 a Publisher.
  • Method Details

    • read

      Publisher<Read> read()
      Returns Publisher that emits all items as read from this connection.
      Returns:
      Publisher that emits all items as read from this connection. Concurrent subscribes when a PublisherSource.Subscriber is already active) are disallowed but sequential subscribes when a previous PublisherSource.Subscriber has terminated) are allowed.
    • write

      Completable write(Publisher<Write> write)
      Writes all elements emitted by the passed Publisher on this connection.
      Parameters:
      write - Publisher, all objects emitted from which are written on this connection.
      Returns:
      Completable that terminates as follows:
      • With an error, if any item emitted can not be written successfully on the connection.
      • With an error, if Publisher emits an error.
      • With an error, if there is a already an active write on this connection.
      • Successfully when Publisher completes and all items emitted are written successfully.
    • write

      Completable write(Publisher<Write> write, Supplier<FlushStrategy> flushStrategySupplier, Supplier<WriteDemandEstimator> demandEstimatorSupplier)
      Writes all elements emitted by the passed Publisher on this connection.
      Parameters:
      write - Publisher, all objects emitted from which are written on this connection.
      flushStrategySupplier - Supplier of FlushStrategy which controls the flush operations for this write.
      demandEstimatorSupplier - A Supplier of WriteDemandEstimator for this write.
      Returns:
      Completable that terminates as follows:
      • With an error, if any item emitted can not be written successfully on the connection.
      • With an error, if Publisher emits an error.
      • With an error, if there is a already an active write on this connection.
      • Successfully when Publisher completes and all items emitted are written successfully.