Swoole\Event::exit

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();