phpday 2027 - Call for Papers

swoole_async_read

(PECL swoole >= 1.9.0)

swoole_async_read — Read file stream asynchronously

Description

function swoole_async_read(
    string $filename,
    callable $callback,
    int $chunk_size = 65536,
    int $offset = 0
): bool

Parameters

filename

The filename of the file being read.

callback
function callback(string $filename, string $content): mixed
filename

The name of the file.

content

The content read from the file stream.

chunk_size

The chunk length.

offset

The offset.

Return Values

Whether the read is succeed.

User Contributed Notes

There are no user contributed notes for this page.
Adding new notes is disabled. Please see the links in the Found A Problem? section.
To Top