PHP code example of wyrihaximus / recoil-promise-coroutine-wrapper

1. Go to this page and download the library: Download wyrihaximus/recoil-promise-coroutine-wrapper library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

wyrihaximus / recoil-promise-coroutine-wrapper example snippets


// Have the event loop ready
$loop = Factory::create();

// Create the wrapper from the event loop, internally this will set up all the sult = $wrapper->call(function (LoopInterface $loop, int $wait) {
    yield timedPromise($loop, $wait);
    
    return $wait;
}, $loop, $wait)