Join 4,000+ others and never miss out on new tips, tutorials, and more.
Latest version:
pecl install openswoole-22.1.2 | composer require openswoole/core:22.1.5
<?php OpenSwoole\Event::defer(callable $callback)\:\ void
Defer a function or any callable to the next loop cycle
Defer a function or any callable to the next Loop cycle once the current round of the event loop has completed all its tasks. The callable does not accept any parameters but you may use the anonymous function use
syntax to pass variables over. This function is executed before the start of the next event loop round.
<?php
OpenSwoole\Event::defer(function(){
echo "After EventLoop\n";
});