Swoole\Event::defer
PHP function
Edit on GitHub ✎
(PECL swoole >= 1.9.0)
Execute a function at the start of the next event loop
Description
Swoole\Event::defer(callable $callback_function): void
Schedules a function to run at the start of the next event loop iteration.
Parameters
callback_functionCallback function to execute (no parameters allowed; use
usefor closure variables).
Return Values
No return value.
Examples
Swoole\Event::defer() example
php
<?php
Swoole\Event::defer(function(){
echo "After EventLoop\n";
});
?>