2017 © Pedro Peláez
 

library phing-foreach-parallel-task

phing task to run sub-tasks in a foreach-loop in separate, parallel processes

image

mak/phing-foreach-parallel-task

phing task to run sub-tasks in a foreach-loop in separate, parallel processes

  • Tuesday, October 28, 2014
  • by mkrauser
  • Repository
  • 2 Watchers
  • 4 Stars
  • 12,729 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 1 Forks
  • 1 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

ForeachParallel-Task for Phing

project status, (*1)

Maintainer Contact

Matthias Krauser mail: matthias@krauser.eu twitter: @mat_krauser, (*2)

Changelog

1.0.0 (2014-10-27)

  • initial release

Documentation

The foreach-parallel-task for phing behaves exactly like the normal foreach-task. From the documentation of the foreach-task:, (*3)

The foreach task iterates over a list, a list of filesets, or both. If both, list and filesets, are specified, the list will be evaluated first. Nested filesets are evaluated in the order they appear in the task., (*4)

The only difference is, that the iterations are not executed sequentially but parallel. It like a foreach-version of phing's ParallelTask., (*5)

This only works on *nix machines with pcntl-extension installed. If the requirements are not fullfilled, the foreach-parallel-task will behave like a regular foreach-task., (*6)

Installation

The suggested installation method is via composer:, (*7)

php composer.phar require "doctrine/instantiator:~1.0.3"

Usage

  • Load the task in your phing build-file
<taskdef name="foreach_parallel" classname="MaK\Phing\Task\ForeachParallelTask" />
  • Call the task: The syntax is exactly the same as the original task. The only difference is the optional threadCount-Attribute, to specify the maximum number of threads / processes to use. If not specified, the library will try to guess the best number.
<foreach_parallel list="..." param="some_param" target="target-task" threadCount="4"/>

Credits

This library task was heavily inspired by ParallelTask from Michiel Rook (mrook@php.net), which is part of the Phing-Core., (*8)

The Versions

28/10 2014

dev-master

9999999-dev https://github.com/mkrauser/phing-foreach-parallel-task

phing task to run sub-tasks in a foreach-loop in separate, parallel processes

  Sources   Download

MIT

The Requires

 

by Matthias Krauser

27/10 2014

v1.0.0

1.0.0.0 https://github.com/mkrauser/phing-foreach-parallel-task

phing task to run sub-tasks in a foreach-loop in separate, parallel processes

  Sources   Download

MIT

The Requires

 

by Matthias Krauser