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::dispatch()\:\ void
Waits for I/O events only once. Compared with Event::wait
, it calls epoll_wait
only once, allowing the developer to control when to wait. The purpose of this function is to allow frameworks and low level libraries to maintain control of the event loop, as Event::wait
only lets Swoole control everything and not other processes.
<?php
while(true) {
Swoole\Event::dispatch();
}