php8.5
Home/ Manual/ swoole / async/ Swoole\Async::read

Swoole\Async::read

PHP function Edit on GitHub ✎

(PECL swoole >= 1.9.0)

Read file stream asynchronously.

Description

Swoole\Async::read(string $filename, callable $callback, [int $chunk_size], [int $offset]): bool

Parameters

filename

The name of the file.

callback
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.

Source: reference/swoole/swoole/async/read.xml · from the official PHP manual (php/doc-en)