writeAndFlush(_:promise:)

Send a write event followed by a flush event to the next outbound ChannelHandler in the ChannelPipeline. When the write event reaches the HeadChannelHandler the data will be enqueued to be written when the flush also reaches the HeadChannelHandler.

ChannelPipeline.swift:1985
func writeAndFlush(_ data: NIOAny, promise: EventLoopPromise<Void>?)

Parameters

data

The data to write, should be of type ChannelOutboundHandler.OutboundOut.

promise

The promise fulfilled when the previously written data been written and flushed or if that failed.