LonghornPHP 2026

Swoole\Event::defer

(PECL swoole >= 1.9.0)

Swoole\Event::deferExecute a function at the start of the next event loop

说明

public static function Swoole\Event::defer(callable $callback_function): void

Schedules a function to run at the start of the next event loop iteration.

参数

callback_function

Callback function to execute (no parameters allowed; use use for closure variables).

返回值

No return value.

示例

示例 #1 Swoole\Event::defer() example

<?php
Swoole\Event::defer(function(){
    echo "After EventLoop\n";
});
?>

添加备注

用户贡献的备注

此页面尚无用户贡献的备注。
To Top