Skip to content

Wait until possible to resume writing to socket

Maciej Pawel Szymanski requested to merge maszyman-drain-write into master

As per docs:

Wait until it is appropriate to resume writing to the stream. Example:

writer.write(data)
await writer.drain()

This is a flow control method that interacts with the underlying IO write buffer. When the size of the buffer reaches the high watermark, drain() blocks until the size of the buffer is drained down to the low watermark and writing can be resumed. When there is nothing to wait for, the drain() returns immediately.

This may help in Geant4 case where we send through socket the whole output of cmake command.

Merge request reports