Swoole\Event::dispatch

4.x is outdated, please check the latest version 22.x


Latest version: pecl install openswoole-22.1.2

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 August 31, 2022