ChannelOutboundInvoker

public protocol ChannelOutboundInvoker

Allows users to invoke an outbound operation related to a Channel that will flow through the ChannelPipeline until it will finally be executed by the the ChannelCore implementation.

  • register() Default implementation

    Register on an EventLoop and so have all its IO handled.

    Default Implementation

    Declaration

    Swift

    func register() -> EventLoopFuture<Void>

    Return Value

    the future which will be notified once the operation completes.

  • Register on an EventLoop and so have all its IO handled.

    Declaration

    Swift

    func register(promise: EventLoopPromise<Void>?)
  • bind(to:) Default implementation

    Bind to a SocketAddress.

    Default Implementation

    Declaration

    Swift

    func bind(to: SocketAddress) -> EventLoopFuture<Void>

    Return Value

    the future which will be notified once the operation completes.

  • Bind to a SocketAddress.

    Declaration

    Swift

    func bind(to: SocketAddress, promise: EventLoopPromise<Void>?)
  • connect(to:) Default implementation

    Connect to a SocketAddress.

    Default Implementation

    Declaration

    Swift

    func connect(to: SocketAddress) -> EventLoopFuture<Void>

    Return Value

    the future which will be notified once the operation completes.

  • Connect to a SocketAddress.

    Declaration

    Swift

    func connect(to: SocketAddress, promise: EventLoopPromise<Void>?)
  • write(_:) Default implementation

    Write data to the remote peer.

    Be aware that to be sure that data is really written to the remote peer you need to call flush or use writeAndFlush. Calling write multiple times and then flush may allow the Channel to write multiple data objects to the remote peer with one syscall.

    Default Implementation

    Declaration

    Swift

    func write(_ data: NIOAny) -> EventLoopFuture<Void>

    Return Value

    the future which will be notified once the operation completes.

  • Write data to the remote peer.

    Be aware that to be sure that data is really written to the remote peer you need to call flush or use writeAndFlush. Calling write multiple times and then flush may allow the Channel to write multiple data objects to the remote peer with one syscall.

    Declaration

    Swift

    func write(_ data: NIOAny, promise: EventLoopPromise<Void>?)
  • Flush data that was previously written via write to the remote peer.

    Declaration

    Swift

    func flush()
  • writeAndFlush(_:) Default implementation

    Shortcut for calling write and flush.

    Default Implementation

    Declaration

    Swift

    func writeAndFlush(_ data: NIOAny) -> EventLoopFuture<Void>

    Return Value

    the future which will be notified once the write operation completes.

  • Shortcut for calling write and flush.

    Declaration

    Swift

    func writeAndFlush(_ data: NIOAny, promise: EventLoopPromise<Void>?)
  • Signal that we want to read from the Channel once there is data ready.

    If ChannelOptions.autoRead is set for a Channel (which is the default) this method is automatically invoked by the transport implementation, otherwise it’s the user’s responsibility to call this method manually once new data should be read and processed.

    Declaration

    Swift

    func read()
  • close(mode:) Default implementation

    Close the Channel and so the connection if one exists.

    Default Implementation

    Declaration

    Swift

    func close(mode: CloseMode) -> EventLoopFuture<Void>

    Return Value

    the future which will be notified once the operation completes.

  • Close the Channel and so the connection if one exists.

    Declaration

    Swift

    func close(mode: CloseMode, promise: EventLoopPromise<Void>?)
  • triggerUserOutboundEvent(_:) Default implementation

    Trigger a custom user outbound event which will flow through the ChannelPipeline.

    Default Implementation

    Declaration

    Swift

    func triggerUserOutboundEvent(_ event: Any) -> EventLoopFuture<Void>

    Return Value

    the future which will be notified once the operation completes.

  • Trigger a custom user outbound event which will flow through the ChannelPipeline.

    Declaration

    Swift

    func triggerUserOutboundEvent(_ event: Any, promise: EventLoopPromise<Void>?)
  • The EventLoop which is used by this ChannelOutboundInvoker for execution.

    Declaration

    Swift

    var eventLoop: EventLoop { get }