xp-forge/sequence — pull request #6 by thekid (2014-11-24 22:21:47+00:00)
Title: Feature: Distribute work

This PR allows distributing elements from a sequence on workers:

```php
$workers= [
new LocalWorkerProcess('com.example.parallel.ImageResizer', [800, 600]),
new LocalWorkerProcess('com.example.parallel.ImageResizer', [800, 600])
];

$results= Sequence::of($files)
->filter(new ExtensionEqualsFilter('.jpg'))
->map(function($e) { return $e->getUri(); })
->distribute(new WorkerProcesses($workers))
->each('util.cmd.Console::writeLine')
;

foreach ($workers as $worker) {
$worker->shutdown();
}
```