2017 © Pedro Peláez
 

library spork

Asynchronous PHP

image

kriswallsmith/spork

Asynchronous PHP

  • Monday, May 18, 2015
  • by kriswallsmith
  • Repository
  • 40 Watchers
  • 588 Stars
  • 526,965 Installations
  • PHP
  • 16 Dependents
  • 4 Suggesters
  • 54 Forks
  • 25 Open issues
  • 4 Versions
  • 5 % Grown

The README.md

Build Status, (*1)

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., (*2)

<?php

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

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

The Versions

18/05 2015

dev-master

9999999-dev https://github.com/kriswallsmith/spork

Asynchronous PHP

  Sources   Download

MIT

The Requires

 

18/05 2015

v0.3

0.3.0.0 https://github.com/kriswallsmith/spork

Asynchronous PHP

  Sources   Download

MIT

The Requires

 

21/03 2013

v0.2

0.2.0.0 https://github.com/kriswallsmith/spork

Asynchronous PHP

  Sources   Download

MIT

The Requires

 

31/05 2012

v0.1

0.1.0.0 https://github.com/kriswallsmith/spork

Asynchronous PHP

  Sources   Download

MIT

The Requires