library pipeline
Framework for creating task pipelines
warmans/pipeline
Framework for creating task pipelines
- Friday, December 5, 2014
- by warmans
- Repository
- 2 Watchers
- 0 Stars
- 445 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 5 Versions
- 0 % Grown
pipeline
, (*1)
Create a task pipline for seperating complex operations into smaller testable units., (*2)
Sample useage:, (*3)
use Pipeline\Pipeline;
use Pipeline\Workload;
use Pipeline\Workload\Task;
use Pipeline\Stage\CallbackStage;
//setup two tasks
$workload = new Workload();
$workload->addTask(new Workload\Task('foo'));
$workload->addTask(new Workload\Task('bar'));
//setup a pipeline
$pipeline = new Pipeline();
//setup two stages
$pipeline->addStage(new CallbackStage('first-stage', function (Task $task) {
$task->setMeta('done-first', true);
}));
$pipeline->addStage(new CallbackStage('second-stage', function (Task $task) {
$task->setMeta('done-second', true);
}));
//setup the context to enable logging
$context = new Context();
$context->setLogger(function($msg, $writeLn=true) {
echo $msg . ($writeLn ? "\n" : "");
});
//execute
$pipeline->execute($workload, $context);
var_dump($workload);
dev-scrutinizer-patch-1
dev-scrutinizer-patch-1
Framework for creating task pipelines
Sources
Download
The Development Requires
by
swarman
dev-master
9999999-dev
Framework for creating task pipelines
Sources
Download
The Development Requires
by
swarman
0.0.3
0.0.3.0
Framework for creating task pipelines
Sources
Download
The Development Requires
by
swarman
0.0.2
0.0.2.0
Framework for creating task pipelines
Sources
Download
The Development Requires
by
swarman
0.0.1
0.0.1.0
Framework for creating task pipelines
Sources
Download
The Development Requires
by
swarman