OpenSwoole\Event::wait

Latest version: pecl install openswoole-22.1.2 | composer require openswoole/core:22.1.5

Declaration

<?php OpenSwoole\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

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

OpenSwoole\Event::wait();

echo " world\n";
Last updated on September 1, 2022