php8.5
Home/ Manual/ swoole / event/ Swoole\Event::wait

Swoole\Event::wait

PHP function Edit on GitHub ✎

(PECL swoole >= 1.9.0)

Start event loop

Description

Swoole\Event::wait(): void

Starts the event loop. Place this at the end of your PHP program.

Return Values

No return value.

Examples

Swoole\Event::wait() example

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

Swoole\Event::wait();
?>

Source: reference/swoole/swoole/event/wait.xml · from the official PHP manual (php/doc-en)