PHP Classes

File: examples/run_and_forget.php

Recommend this page to a friend!
  Classes of Alexandre Sinício   PHP Async Executor   examples/run_and_forget.php   Download  
File: examples/run_and_forget.php
Role: Example script
Content type: text/plain
Description: Example script
Class: PHP Async Executor
Run PHP scripts in parallel using the CLI version
Author: By
Last change:
Date: 3 years ago
Size: 354 bytes
 

Contents

Class file image Download
<?php
use alesinicio\AsyncExecutor\AsyncExecutor;

require
__DIR__.'/../vendor/autoload.php';

//INITIALIZE THE EXECUTOR
$async = new AsyncExecutor('/usr/bin/php');

//RUN THE PROCESS
$pid = $async->runProcess(__DIR__.'/bg_process.php', ['param01', 'param02']);

//CHECK IF PROCESS IS RUNNING BY CHECKING ITS PID
var_dump($async->isProcessRunning($pid));