Give the write buffer of the underlying transport a chance to be flushed.
The intended use is to write:
w.write(data)
w.drain()
When the size of the transport buffer reaches the high-water limit (the
protocol is paused), block until the size of the buffer is drained down
to the low-water limit and the protocol is resumed. When there is nothing
to wait for, continue immediately.
Calling $(D_PSYMBOL drain()) gives the opportunity for the loop to
schedule the write operation and flush the buffer. It should especially
be used when a possibly large amount of data is written to the transport,
and the coroutine does not process the event loop between calls to
$(D_PSYMBOL write()).
Give the write buffer of the underlying transport a chance to be flushed.
The intended use is to write:
w.write(data) w.drain()
When the size of the transport buffer reaches the high-water limit (the protocol is paused), block until the size of the buffer is drained down to the low-water limit and the protocol is resumed. When there is nothing to wait for, continue immediately.
Calling $(D_PSYMBOL drain()) gives the opportunity for the loop to schedule the write operation and flush the buffer. It should especially be used when a possibly large amount of data is written to the transport, and the coroutine does not process the event loop between calls to $(D_PSYMBOL write()).