Join 4,000+ others and never miss out on new tips, tutorials, and more.
4.x is outdated, please check the latest version 22.x
Latest version:
pecl install openswoole-22.1.2
<?php Swoole\Event::wait()\:\ void
Waits for I/O events to complete. It calls epoll_wait
and maintains the event loop and waits for it to fully complete before moving on, allowing you to wait for the tasks on the event loop to finish before continuing.
<?php
Swoole\Timer::tick(1000, function () {
echo "hello";
});
Swoole\Event::wait();
echo " world\n";