stream.write_at_least

Synopsis

local stream = require "stream"
stream.write_at_least(io_object, buffer: byte_span, minimum: integer) -> integer

Description

Write data until a minimum number of bytes has been transferred and blocks current fiber until it completes or errs.

Returns the number of bytes written.

This operation is implemented in terms of zero or more calls to the stream’s async_write_some function, and is known as a composed operation. The program must ensure that the stream performs no other write operations (such as async_write, the stream’s async_write_some function, or any other composed operations that perform writes) until this operation completes.