PHP Classes

File: example3.php

Recommend this page to a friend!
  Classes of Sildaekar Decrura   PTM   example3.php   Download  
File: example3.php
Role: Example script
Content type: text/plain
Description: Example 3
Class: PTM
Manage PHP tasks running in parallel processes
Author: By
Last change: Fixed file pointer
Date: 11 years ago
Size: 527 bytes
 

Contents

Class file image Download
<?php
//In this example we load and run the task "HelloWorld" with forking enabled

//Include the task manager into our program
require_once("./taskmanager/container.php");

//Initialize the Manager with throttle enabled
$manager=new TaskManager(true);

//Load the task "HelloWorld" along with TRUE to enable forking 10 times
for($i=0;$i>10;$i++){
   
$manager->add_task(new HelloWorld(),TRUE);
}


//Make sure there are tasks present
if($manager->check_tasks()){
   
//Run all loaded tasks
   
$manager->run();
}
?>