iripvanwinkle/queue-processes

It is the queue container for symfony/process

v1.0.1 2016-09-16 09:37 UTC

This package is not auto-updated.

Last update: 2024-04-27 16:58:05 UTC


README

Build Status GitHub license Yii2

The queue for symfony/process

Install

Via Composer

$ composer require iripvanwinkle/queue-processes

Usage

    $queue = new QueueProcesses();
    foreach (range(1, 10) as $index) {
        $queue->addCommand("echo $index", function ($type, $buffer) use (&$commonBuffer) {
            $commonBuffer .= $buffer;
        });
    }
    
    $queue->setLimit(2);
    $queue->run();

    echo $commonBuffer; // Output: 1\n2\n3\n4\n5\n6\n7\n8\n9\n10

Testing

$ composer test

License

The MIT License (MIT). Please see License File for more information.