readOutbound(as:)

    If available, this method reads one element of type T out of the EmbeddedChannel’s outbound buffer. If the first element was of a different type than requested, EmbeddedChannel.WrongTypeError will be thrown, if there are no elements in the outbound buffer, nil will be returned.

    Embedded.swift:724
    func readOutbound<T>(as type: T.Type = T.self) throws -> T?

    Data hits the EmbeddedChannel’s outbound buffer when data was written using write, then flushed, and then travelled the ChannelPipeline all the way too the front. For data to hit the outbound buffer, the very first ChannelHandler must have written and flushed it either explicitly (by calling ChannelHandlerContext.write and flush) or implicitly by not implementing write/flush.

    Other members in extension

    Types

    • enum BufferState

      BufferState represents the state of either the inbound, or the outbound EmbeddedChannel buffer. These buffers contain data that travelled the ChannelPipeline all the way.

    • enum LeftOverState

      LeftOverState represents any left-over inbound, outbound, and pending outbound events that hit the EmbeddedChannel and were not consumed when finish was called on the EmbeddedChannel.

    • struct SynchronousOptions
    • struct WrongTypeError

      WrongTypeError is throws if you use readInbound or readOutbound and request a certain type but the first item in the respective buffer is of a different type.

    Type members

    Instance members

    Show implementation details (1)

    Hide implementation details