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::exit()\:\ void
Exit the Event Loop, only available at client side, meaning, you can exit and stop the event loop you are currently in but not the main server event loop.
<?php
Swoole\Timer::tick(1000, function() {
echo "tick\n";
Swoole\Event::exit();
});
Swoole\Event::wait();