src/functions.php
/**
 * Run an action inside a fresh event loop
 *
 * Shortcut to create an event loop with default settings, that suits for most cases.
 *
 * @param callable $action
 *
 * @return void
 */
Run an action inside a fresh event loop
Shortcut to create an event loop with default settings, that suits for most cases.

@param callable $action

@return void
Run an action inside a fresh event loop Shortcut to create an event loop with default settings that suits for most cases . @param callable $action @return void
function run(callable $action)
{
    $loop = Factory::create();
    \GuzzleHttp\Promise\queue(new ReactTaskQueue($loop));
    $loop->futureTick(function() use ($loop, $action){
        $action($loop);
    });
    $loop->run();
}
function run ( callable $ action ) { $ loop = Factory :: create ( ) ; \ GuzzleHttp \ Promise \ queue ( new ReactTaskQueue ( $ loop ) ) ; $ loop -> futureTick ( function ( ) use ( $ loop , $ action ) { $ action ( $ loop ) ; } ) ; $ loop -> run ( ) ; }
Run an action inside a fresh event loop
 Shortcut to create an event loop with default settings, that suits for most cases.
Run an action inside a fresh event loop Shortcut to create an event loop with default settings that suits for most cases .