PHP code example of icicleio / react-adapter

1. Go to this page and download the library: Download icicleio/react-adapter 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/ */

    

icicleio / react-adapter example snippets


use Icicle\ReactAdapter\Loop\ReactLoop;
use Predis\Async\Client;

// Create the loop adapter.
$loop = new ReactLoop();

// $loop can be used anywhere an instance of React\EventLoop\LoopInterface is 

$iciclePromise = new \Icicle\Awaitable\Promise(function ($resolve, $reject) {
    // Resolver
});

$reactPromise = new \Icicle\ReactAdapter\Promise\ReactPromise($iciclePromise);

$reactPromise = new \React\Promise\Promise(function ($resolve, $reject) {
    // Resolver
});

$awaitable = \Icicle\Awaitable\adapt($reactPromise);