OpenSwoole\Event::exit

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

Declaration

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

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

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

});

OpenSwoole\Event::wait();
Last updated on September 1, 2022