Swoole\Event::dispatch

Latest version: pecl install openswoole-4.11.1

Declaration

<?php Swoole\Event::dispatch()\:\ void

Parameters

none

Return

void

Description

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.

Example

<?php
while(true) {
    Swoole\Event::dispatch();
}
Last updated on March 31, 2022