2017 © Pedro Peláez
 

library forker

Split tasks into multiple forked processes.

image

hasantayyar/forker

Split tasks into multiple forked processes.

  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 1 Versions
  • 0 % Grown

The README.md

Forker

Build Status, (*1)

Forker presents a simple interfacing for forking in PHP., (*2)

What is different in this fork

All same but this fork packed for composer., (*3)

Install

composer require hasantayyar/forker:dev-master

Getting Started

<?php
use Hasantayyar\Forker\Forker;
$servers = array('machine1.example.com', 'machine2.example.com');

/**
 * Run a shell command on an array of servers using SSH,
 * returning the output and exit code.
 */
function runCmd($command, $servers) {
    return Forker::map($servers,
    function($index, $server) use ($command) {
        $sshCommand = "ssh $server -c '$command' 2>&1";
        exec($sshCommand, $exitCode, $output);
        return array(
            'output' => implode("\n", $output),
            'exitCode' => $exitCode
        );
    });
}

$results = runCmd("hostname", $servers);
print_r($results);

Circle CI, (*4)

The Versions

02/09 2014

dev-master

9999999-dev

Split tasks into multiple forked processes.

  Sources   Download

LGPL

The Requires

  • php >=5.3.0

 

by @htayyar

worker fork tasks