Swoole\Event::wait

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


Latest version: pecl install openswoole-22.1.2

Declaration

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

Parameters

none

Return

void

Description

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.

Example

<?php

Swoole\Timer::tick(1000, function () {
    echo "hello";
});

Swoole\Event::wait();

echo " world\n";
Last updated on August 31, 2022