php8.5
Home/ Manual/ swoole / runtime/ Swoole\Runtime::enableCoroutine

Swoole\Runtime::enableCoroutine

PHP function Edit on GitHub ✎

Enable coroutine for specified functions

Description

Swoole\Runtime::enableCoroutine(int $flags = SWOOLE_HOOK_ALL): void

This method enables coroutine support for specified PHP functions based on the given flags. It should be called once at the beginning of the application.

Parameters

flags

Bitmask of flags specifying which functions to hook. Can be combined using | operator. Available flags: SWOOLE_HOOK_TCP, SWOOLE_HOOK_UDP, SWOOLE_HOOK_UNIX, SWOOLE_HOOK_UDG, SWOOLE_HOOK_SSL, SWOOLE_HOOK_TLS, SWOOLE_HOOK_SLEEP, SWOOLE_HOOK_FILE, SWOOLE_HOOK_STREAM_FUNCTION, SWOOLE_HOOK_BLOCKING_FUNCTION, SWOOLE_HOOK_PROC, SWOOLE_HOOK_CURL, SWOOLE_HOOK_NATIVE_CURL, SWOOLE_HOOK_SOCKETS, SWOOLE_HOOK_STDIO, SWOOLE_HOOK_PDO_PGSQL, SWOOLE_HOOK_PDO_ODBC, SWOOLE_HOOK_PDO_ORACLE, SWOOLE_HOOK_PDO_SQLITE, or SWOOLE_HOOK_ALL for all flags.

Return Values

Void

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