Popularity
5.2
Declining
Activity
0.0
Stable
591
34
55

Description

Feed an iterator into the process manager and it will break the job into multiple batches and spread them across many processes.

Code Quality Rank: L5
Programming language: PHP
License: MIT License
Tags: Miscellaneous    
Latest version: v0.3

Spork alternatives and similar libraries

Based on the "Miscellaneous" category.
Alternatively, view Spork alternatives based on common mentions on social networks and blogs.

Do you think we are missing an alternative of Spork or a related project?

Add another 'Miscellaneous' Library

README

Build Status

Spork: PHP on a Fork

<?php

$manager = new Spork\ProcessManager();
$manager->fork(function() {
    // do something in another process!
    return 'Hello from '.getmypid();
})->then(function(Spork\Fork $fork) {
    // do something in the parent process when it's done!
    echo "{$fork->getPid()} says '{$fork->getResult()}'\n";
});

Example: Upload images to your CDN

Feed an iterator into the process manager and it will break the job into multiple batches and spread them across many processes.

<?php

$files = new RecursiveDirectoryIterator('/path/to/images');
$files = new RecursiveIteratorIterator($files);

$manager->process($files, function(SplFileInfo $file) {
    // upload this file
});