HH\Lib\IO\WriteHandle::writeAllowPartialSuccessAsync

Meta Engineer?

The containing class is available as IO\WriteHandle in the www repository.

Write data, waiting if necessary

public function writeAllowPartialSuccessAsync(
  string $bytes,
  ?int $timeout_ns = NULL,
): Awaitable<int>;

A wrapper around write() that will wait if write() would throw an OS\BlockingIOException

It is possible for the write to partially succeed - check the return value and call again if needed.

Parameters

  • string $bytes
  • ?int $timeout_ns = NULL

Returns

  • the - number of bytes written, which may be less than the length of input string.