Login   Register  
PHP Classes
elePHPant
Icontem

Forker PHP: Split tasks into multiple forked processes

Recommend this page to a friend!
Stumble It! Stumble It! Bookmark in del.icio.us Bookmark in del.icio.us
  Info   View files View files (24)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings  
2014-06-08 (4 months ago) RSS 2.0 feedNot enough user ratingsTotal: 266 This week: 1All time: 6,805 This week: 1,524Up
Version License PHP version Categories  
forker 1.0.2MIT/X Consortium License5.3PHP 5, Unix, Language
Description Author  

This package can split tasks into multiple forked processes.

The main class takes an array of data to be processed as the whole task and creates child processes giving one element of the tasks array to be processed by each child process by calling given a given function that will process the respective task data.

It uses a separate storage object to store and retrieve task data to be shared between processes.

Currently it provides different storage classes that can store task data in memory as arrays, in files, or in a MemCached server.

Innovation Award  
PHP Programming Innovation award nominee
May 2014
Number 4


Prize: PhpStorm IDE personal permanent license
Some CPU intensive tasks can be executed more efficiently if they are split into processes running in parallel. That way it takes advantage of multiple CPU cores that may be available.

This class can manage the split of processing of array data using forked processes to execute the same processing task in parallel to process each array element.

Manuel Lemos
Picture of Daniel Martinez
Name: Daniel Martinez <contact>
Classes: 2 packages by
Country: Spain Spain
Age: 28
All time rank: 162135 in Spain Spain
Week rank: 400 Up11 in Spain Spain Up
Innovation award
Innovation award
Nominee: 1x

  Files folder image Files  
File Role Description
Files folder imageexamples (3 files, 1 directory)
Files folder imagesrc (1 directory)
Files folder imagetests (1 file, 1 directory)
Accessible without login Plain text file .travis.yml Data Auxiliary data
Accessible without login Plain text file composer.json Data Auxiliary data
Accessible without login Plain text file LICENSE.md Data Auxiliary data
Accessible without login Plain text file phpunit.xml Data Auxiliary data
Accessible without login Plain text file README.md Data Auxiliary data

  Files folder image Files  /  examples  
File Role Description
Files folder imageMapReduce (4 files)
  Accessible without login Plain text file demo.api.weather.file-storage.php Example Example script
  Accessible without login Plain text file demo.api.weather.php Example Example script
  Accessible without login Plain text file demo.sum.php Example Example script

  Files folder image Files  /  examples  /  MapReduce  
File Role Description
  Accessible without login Plain text file demo.map-reduce.php Example Example script
  Accessible without login Plain text file quijote-1.txt Data Auxiliary data
  Accessible without login Plain text file quijote-2.txt Data Auxiliary data
  Accessible without login Plain text file quijote-3.txt Data Auxiliary data

  Files folder image Files  /  src  
File Role Description
Files folder imageForker (1 file, 2 directories)

  Files folder image Files  /  src  /  Forker  
File Role Description
Files folder imageException (2 files)
Files folder imageStorage (4 files)
  Plain text file Forker.php Class Class source

  Files folder image Files  /  src  /  Forker  /  Exception  
File Role Description
  Plain text file ForkingErrorException.php Class Class source
  Plain text file StorageException.php Class Class source

  Files folder image Files  /  src  /  Forker  /  Storage  
File Role Description
  Plain text file ArrayStorage.php Class Class source
  Plain text file FileStorage.php Class Class source
  Plain text file MemcacheStorage.php Class Class source
  Plain text file StorageInterface.php Class Class source

  Files folder image Files  /  tests  
File Role Description
Files folder imageunit (1 file, 1 directory)
  Accessible without login Plain text file bootstrap.php Aux. Auxiliary script

  Files folder image Files  /  tests  /  unit  
File Role Description
Files folder imageStorage (3 files)
  Accessible without login Plain text file ForkerTest.php Test Unit test script

  Files folder image Files  /  tests  /  unit  /  Storage  
File Role Description
  Accessible without login Plain text file ArrayStorageTest.php Test Unit test script
  Accessible without login Plain text file BaseStorageTest.php Test Unit test script
  Accessible without login Plain text file FileStorageTest.php Test Unit test script

 Version Control Unique User Downloads Download Rankings  
 100%Total:266All time:6,805
 This week:1This week:1,524Up