Swoole\Event::exit

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


Latest version: pecl install openswoole-22.1.2

Declaration

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

Parameters

none

Return

void

Description

Exit the Event Loop, only available at client side, meaning, you can exit and stop the event loop you are currently in but not the main server event loop.

Example

<?php

Swoole\Timer::tick(1000, function() {

    echo "tick\n";
    Swoole\Event::exit();

});

Swoole\Event::wait();
Last updated on August 31, 2022