spork

Experimental library for forking PHP

  • Owner: kriswallsmith/spork
  • Platform:
  • License:: MIT License
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

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
});

Main metrics

Overview
Name With Ownerkriswallsmith/spork
Primary LanguagePHP
Program languagePHP (Language Count: 1)
Platform
License:MIT License
所有者活动
Created At2012-04-10 03:31:04
Pushed At2016-03-17 13:22:16
Last Commit At2015-05-18 12:16:02
Release Count3
Last Release Namev0.3 (Posted on )
First Release Namev0.1 (Posted on )
用户参与
Stargazers Count586
Watchers Count33
Fork Count52
Commits Count99
Has Issues Enabled
Issues Count25
Issue Open Count16
Pull Requests Count7
Pull Requests Open Count8
Pull Requests Close Count4
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private