PHP 8.6.0 Beta 1 is available for testing

Swoole\Event::defer

(PECL swoole >= 1.9.0)

Swoole\Event::deferExecute a function at the start of the next event loop

Beschreibung

public static function Swoole\Event::defer(callable $callback_function): void

Schedules a function to run at the start of the next event loop iteration.

Parameter-Liste

callback_function
Callback function to execute (no parameters allowed; use use for closure variables).

Rückgabewerte

No return value.

Beispiele

Beispiel #1 Swoole\Event::defer() example

<?php
Swoole\Event::defer(function(){
    echo "After EventLoop\n";
});
?>

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top