Login   Register  
PHP Classes
elePHPant
Icontem

File: example2.php

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Classes of Sildaekar Decrura  >  PTM  >  example2.php  >  Download  
File: example2.php
Role: Example script
Content type: text/plain
Description: Example 2
Class: PTM
Manage PHP tasks running in parallel processes
Author: By
Last change: Fixed file pointer
Date: 2 years ago
Size: 562 bytes
 

Contents

Class file image Download
<?php
//In this example we load a task and then
//proceed to unload it based on the key.

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

//Initialize the Manager
$manager=new TaskManager();

//Load the task "HelloWorld" and save the key
$key=$manager->add_task(new HelloWorld());

//Remove the task "HelloWorld"
$manager->remove_task($key,true);

//Check if there are any tasks in the pool
if($manager->check_tasks()){
    echo 
"Tasks present in the pool";
}else{
    echo 
"No Tasks in the pool";
}
?>