waitForInboundWrite(as:)

This method is similar to readInbound(as:) but will wait if the inbound buffer is empty. If available, this method reads one element of type T out of the NIOAsyncTestingChannel’s inbound buffer. If the first element was of a different type than requested, WrongTypeError will be thrown, if there are no elements in the outbound buffer, this method will wait until an element is in the inbound buffer.

AsyncTestingChannel.swift:463
iOS
13.0+
macOS
10.15+
tvOS
13.0+
watchOS
6.0+
func waitForInboundWrite<T>(as type: T.Type = T.self) async throws -> T where T : Sendable

Data hits the NIOAsyncTestingChannel’s inbound buffer when data was send through the pipeline using fireChannelRead and then travelled the ChannelPipeline all the way to the back. For data to hit the inbound buffer, the last ChannelHandler must have send the event either explicitly (by calling ChannelHandlerContext.fireChannelRead) or implicitly by not implementing channelRead.