PHP code example of greendrake / php-asyncprocess

1. Go to this page and download the library: Download greendrake/php-asyncprocess 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/ */

    

greendrake / php-asyncprocess example snippets


use function React\Async\await;
$p = new \Greendrake\AsyncProcess\Promise('a=$( expr 10 - 3 ); echo $a'); // Kick off the process in background.
$result = await($p->get()); // Get the instance of React\Promise\Promise, wait for it to resolve.
echo $result; // outputs "7"