PHPackages                             gendoria/command-queue - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Queues &amp; Workers](/categories/queues)
4. /
5. gendoria/command-queue

ActiveLibrary[Queues &amp; Workers](/categories/queues)

gendoria/command-queue
======================

Library providing command queue

0.2.1(9y ago)13793MITPHPPHP &gt;=5.5.0

Since Oct 12Pushed 9y ago2 watchersCompare

[ Source](https://github.com/Gendoria/command-queue)[ Packagist](https://packagist.org/packages/gendoria/command-queue)[ RSS](/packages/gendoria-command-queue/feed)WikiDiscussions master Synced 4w ago

READMEChangelogDependencies (2)Versions (4)Used By (3)

Command queue library
=====================

[](#command-queue-library)

This library delivers basic interfaces and tools to create command backend delegation system, which allows passing tasks for processing by scallable backend worker infrastructure.

[![Build Status](https://camo.githubusercontent.com/60b6e0274021136fdebf3547ea403b4b3525ddeea68b8c68bb510a332c1e24f0/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f47656e646f7269612f636f6d6d616e642d71756575652f6d61737465722e737667)](https://travis-ci.org/Gendoria/command-queue)[![Scrutinizer Code Quality](https://camo.githubusercontent.com/62eb2417bbb7e276b4c8299491b87f8bf27e6d45d687dd32f85f6e287112dafb/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f47656e646f7269612f636f6d6d616e642d71756575652e737667)](https://scrutinizer-ci.com/g/Gendoria/command-queue/?branch=master)[![Code Coverage](https://camo.githubusercontent.com/8c27e7a241f867bba71538eff073c1d643a44e83dcdff5d1dd3c39d1732eefa3/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f636f7665726167652f672f47656e646f7269612f636f6d6d616e642d71756575652e737667)](https://scrutinizer-ci.com/g/Gendoria/command-queue/?branch=master)[![Downloads](https://camo.githubusercontent.com/012aab9406a99eecd5a1179a6c6aebde57b93a0cbbcae8bc88e7ef37cf0aeabc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f67656e646f7269612f636f6d6d616e642d71756575652e737667)](https://packagist.org/packages/gendoria/command-queue)[![Latest Stable Version](https://camo.githubusercontent.com/39d782af6e0c3b6f62439a587bef2b41c438b85d9f6255e9e19f1e05862615d6/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f67656e646f7269612f636f6d6d616e642d71756575652e737667)](https://packagist.org/packages/gendoria/command-queue)

Library created in cooperation with [Isobar Poland](http://www.isobar.com/pl/).

[![Isobar Poland](doc/images/isobar.jpg "Isobar Poland logo")](doc/images/isobar.jpg)

Installation
------------

[](#installation)

### Step 1: Download the library

[](#step-1-download-the-library)

Open a command console, enter your project directory and execute the following command to download the latest stable version of this bundle:

```
$ composer require gendoria/command-queue "~0.2.0"
```

This command requires you to have Composer installed globally, as explained in the [installation chapter](https://getcomposer.org/doc/00-intro.md)of the Composer documentation.

Usage
-----

[](#usage)

This library provides building blocks to create command queue system, where you delgate your tasks to a pools of backend workers for further processing.

By itself, it does have a simple implementation of 'direct' command queue, where commands are not sent, but executed locally by a driver.

The simplest example of working queue chain using direct processing driver is below.

```
use Gendoria\CommandQueue\Command\CommandInterface;
use Gendoria\CommandQueue\CommandProcessor\CommandProcessorInterface;
use Gendoria\CommandQueue\ProcessorFactory\ProcessorFactory;
use Gendoria\CommandQueue\SendDriver\DirectProcessingDriver;
use Psr\Log\LoggerInterface;

class SimpleCommand implements CommandInterface
{
    public $testData;

    public function __construct($testData)
    {
        $this->testData = $testData;
    }
}

class SimpleProcessor implements CommandProcessorInterface
{
    /**
     *
     * @var LoggerInterface
     */
    private $logger;

    /**
     * Process command.
     *
     * @param SimpleCommand $command
     */
    public function process(CommandInterface $command)
    {
        echo "Command class: ".get_class($command)."\n";
        echo "Command payload: ".$command->testData."\n";
        echo "\n";
    }

    public function setLogger(LoggerInterface $logger)
    {
        $this->logger = $logger;
    }

    public function supports(CommandInterface $command)
    {
        return $command instanceof SimpleCommand;
    }

}

$simpleProcessor = new SimpleProcessor();

$processorFactory = new ProcessorFactory();
$processorFactory->registerProcessorForCommand(SimpleCommand::class, $simpleProcessor);

$driver = new DirectProcessingDriver($processorFactory);

for ($k = 0; $k < 5; $k++) {
    $command = new SimpleCommand("Test ".($k+1));
    $driver->send($command);
    sleep(1);
}
```

You can find this example in `examples/direct.php` file. If you run it, you should see the following output:

```
$ php example/direct.php
Command class: SimpleCommand
Command payload: Test 1

Command class: SimpleCommand
Command payload: Test 2

Command class: SimpleCommand
Command payload: Test 3

Command class: SimpleCommand
Command payload: Test 4

Command class: SimpleCommand
Command payload: Test 5
```

Direct processing driver is not very usable in real world application, as it does not delegate any tasks. But you can use it at an early stage of your application development, when you know, for tasks you want to delegate to backend processing at later date.

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 66.7% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~6 days

Total

3

Last Release

3536d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0295f054c19f793a2107980d5dffc75dda33e308f5c54b6d58d83de0b5ca1792?d=identicon)[TiS](/maintainers/TiS)

---

Top Contributors

[![TiS](https://avatars.githubusercontent.com/u/233690?v=4)](https://github.com/TiS "TiS (2 commits)")[![scrutinizer-auto-fixer](https://avatars.githubusercontent.com/u/6253494?v=4)](https://github.com/scrutinizer-auto-fixer "scrutinizer-auto-fixer (1 commits)")

### Embed Badge

![Health badge](/badges/gendoria-command-queue/health.svg)

```
[![Health](https://phpackages.com/badges/gendoria-command-queue/health.svg)](https://phpackages.com/packages/gendoria-command-queue)
```

###  Alternatives

[symfony/messenger

Helps applications send and receive messages to/from other applications or via message queues

1.1k128.6M1.4k](/packages/symfony-messenger)[symfony/cache

Provides extended PSR-6, PSR-16 (and tags) implementations

4.2k365.0M3.1k](/packages/symfony-cache)[matomo/matomo

Matomo is the leading Free/Libre open analytics platform

21.6k38.2k](/packages/matomo-matomo)[symfony/amazon-sqs-messenger

Symfony Amazon SQS extension Messenger Bridge

4613.5M20](/packages/symfony-amazon-sqs-messenger)[tempest/framework

The PHP framework that gets out of your way.

2.2k31.1k12](/packages/tempest-framework)[api-platform/metadata

API Resource-oriented metadata attributes and factories

244.5M182](/packages/api-platform-metadata)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
