PHP Classes

Forker PHP: Split tasks into multiple forked processes

Recommend this page to a friend!
  Info   View files View files (29)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Last Updated Ratings Unique User Downloads Download Rankings
2023-06-02 (4 months ago) RSS 2.0 feedNot enough user ratingsTotal: 350 All time: 6,983 This week: 48Up
Version License PHP version Categories
forker 1.0.11MIT/X Consortium ...5.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.

Recommendations

Threads PHP
php_fork

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: 3 packages by
Country: Spain Spain
Age: 37
All time rank: 160237 in Spain Spain
Week rank: 569 Up20 in Spain Spain Up
Innovation award
Innovation award
Nominee: 2x

  Files folder image Files  
File Role Description
Files folder imageexamples (4 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
  Accessible without login Plain text file demo.timeout.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 (5 files, 2 directories)

  Files folder image Files  /  src  /  Forker  
File Role Description
Files folder imageException (2 files)
Files folder imageStorage (4 files)
  Plain text file Alarm.php Class Class source
  Plain text file ChilProcess.php Class Class source
  Plain text file Forker.php Class Class source
  Plain text file ISemaphore.php Class Class source
  Plain text file Semaphore.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:350
This week:0
All time:6,983
This week:48Up