PHP code example of colindev / process

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

    

colindev / process example snippets




use Colin\Process\Manager;

$pool = new Manager();

$pool->add($callable_worker, $params);

// 開出子程序跑 $callable_work ...
$p->exec();

// or 如果需要工作程序的回傳值
$p->exec(function($ret){
    // 就是他了...
});

// 主程序繼續往下執行