OpenSwoole Hook Blocking Function

4.x is outdated, please check the latest version 22.x

Latest version: pecl install openswoole-22.1.2

The SWOOLE_HOOK_BLOCKING_FUNCTION flag will enable coroutine support for blocking PHP functions. Support was added in OpenSwoole v4.4.0.

This includes support for:

  • gethostbyname
  • exec
  • shell_exec



Co::set(['hook_flags' => SWOOLE_HOOK_BLOCKING_FUNCTION]);

    echo shell_exec('ls');
Last updated on August 31, 2022