PHP code example of leeshan87 / reactphp-multi-loop

1. Go to this page and download the library: Download leeshan87/reactphp-multi-loop 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/ */

    

leeshan87 / reactphp-multi-loop example snippets


$loop1 = Factory::create();
$loop1->futureTick(function(){
    echo 'hello ';
});
MultiLoop::addLoop($loop1, 'loop1');
$loop2 = Factory::create();
$loop2->futureTick(function (){
    echo 'world!';
});
MultiLoop::addLoop($loop1, 'loop2');
MultiLoop::tickAll();