PHPackages                             mirocow/yii2-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. mirocow/yii2-queue

ActiveYii2-extension[Queues &amp; Workers](/categories/queues)

mirocow/yii2-queue
==================

Yii 2.0 Non blocking queue extension.

1.0.1(7y ago)1195BSD-3-ClausePHPPHP &gt;=7.0

Since Jul 7Pushed 6y ago2 watchersCompare

[ Source](https://github.com/Mirocow/yii2-queue)[ Packagist](https://packagist.org/packages/mirocow/yii2-queue)[ RSS](/packages/mirocow-yii2-queue/feed)WikiDiscussions master Synced yesterday

READMEChangelogDependencies (3)Versions (5)Used By (0)

Non blocking queue manager for Yii 2.0. It supports queues based on DB, Redis, File etc
=======================================================================================

[](#non-blocking-queue-manager-for-yii-20-it-supports-queues-based-on-db-redis-file-etc)

[![Latest Stable Version](https://camo.githubusercontent.com/0ef500c778a12a453f7697488e1ee9c5ff93b48e484c5f7338495c3e19b8d3f5/68747470733a2f2f706f7365722e707567782e6f72672f6d69726f636f772f796969322d71756575652f762f737461626c65)](https://packagist.org/packages/mirocow/yii2-queue) [![Latest Unstable Version](https://camo.githubusercontent.com/35c2eb031929432da9e584d3472abe561774be8607d7605ce5552c4c0f271721/68747470733a2f2f706f7365722e707567782e6f72672f6d69726f636f772f796969322d71756575652f762f756e737461626c65)](https://packagist.org/packages/mirocow/yii2-queue) [![Total Downloads](https://camo.githubusercontent.com/9f5020fe585a6561d0efc4f8b0858d76e0bd35693902dd4ec619104b1c80b6dc/68747470733a2f2f706f7365722e707567782e6f72672f6d69726f636f772f796969322d71756575652f646f776e6c6f616473)](https://packagist.org/packages/mirocow/yii2-queue) [![License](https://camo.githubusercontent.com/c623a65521f5a2c3958f10a241a422c090860e2ffa8fe2e13b3b36671004f8a2/68747470733a2f2f706f7365722e707567782e6f72672f6d69726f636f772f796969322d71756575652f6c6963656e7365)](https://packagist.org/packages/mirocow/yii2-queue)[![Join the chat at https://gitter.im/Mirocow/yii2-queue](https://camo.githubusercontent.com/abe08b740a4156153736f791393ec4da6619c4be73212e75769f52edacc0e2b5/68747470733a2f2f6261646765732e6769747465722e696d2f4a6f696e253230436861742e737667)](https://gitter.im/Mirocow/yii2-queue?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)[![FOSSA Status](https://camo.githubusercontent.com/efe31a7235c43eb78ec112e92d7a0843a8907d481822808579f90ff32844a3e2/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d2532464d69726f636f77253246796969322d71756575652e7376673f747970653d736869656c64)](https://app.fossa.io/projects/git%2Bgithub.com%2FMirocow%2Fyii2-queue?ref=badge_shield)[![Maintainability](https://camo.githubusercontent.com/901a138a996ddf5794080ff1ca994be5ccb83c68bd21776bb9017f922c6fcafc/68747470733a2f2f6170692e636f6465636c696d6174652e636f6d2f76312f6261646765732f63376262666133663434313234393063383737632f6d61696e7461696e6162696c697479)](https://codeclimate.com/github/Mirocow/yii2-queue/maintainability)

```
----------------------- YII2-QUEUE -----------------------------
Yii2-queue version: 0.0.3          PHP version:7.0.27-0+deb9u1
Process ID: 6930
Channels: 1
Workers: 4
Default queue name: default-queue
----------------------------------------------------------------
Press Ctrl+C to stop. Start success.
Child process starting with PID 6880 ...
Child process 6880 are working...
Child 6880 done
Child process starting with PID 6882 ...
Child process 6882 are working...
Run worker [web] with action [ProductCreate] from common\models\essence\Product
...

```

##### Install:

[](#install)

`php composer.phar require mirocow/yii2-queue "^1.0.0"`

##### Config:

[](#config)

```
'controllerMap' => [
    'queue' => [
        'class' => 'mirocow\queue\controllers\QueueController',
    ],
],

'components' => [

    'queue' => [
        'class' => 'mirocow\queue\components\QueueComponent',
        'queueName' => 'default-queue',
        'workers' => [
            'notification' => [
                'class' => 'mirocow\queue\components\WorkerComponent',
                'action' => [
                    'class' => 'mirocow\queue\controllers\NotificationController',
                ]
            ],
            ...
        ],
        'channels' => [
            'default' => [
                'class' => 'mirocow\queue\components\ChannelComponent',
                    'driver' => [
                        'class' => 'mirocow\queue\drivers\MysqlConnection',
                        'connection' => 'db',
                    ]
                ]
            ],
            ...
        ]
    ]
]
```

Before use apply migrations for using Mysql driver:

```
./yii migrate/up --migrationPath=@vendor/mirocow/yii2-queue/migrations
```

### Usage:

[](#usage)

#### Worker class:

[](#worker-class)

```
namespace \console\controllers;

class NotificationController extends Controller
{
    public function actionSayHello($say)
    {
        \Yii::info($say);
    }
}
```

#### Push message to queue:

[](#push-message-to-queue)

```
Yii::$app->queue->getChannel('default')->push(
    new MessageModel([
        'worker' => 'notification',
        'method' => 'actionSayHello',
        'arguments' => [
            'say' => 'hello!'
        ]
    ])
);
```

#### Run queue worker daemon (console app):

[](#run-queue-worker-daemon-console-app)

```
$ php ./yii queue/run --pid-file=/tmp/queue.pid
```

##### Test:

[](#test)

```
$ ./vendor/bin/codecept -c vendor/mirocow/yii2-queue run unit

XDebug could not open the remote debug file '/var/log/php7-fpm/php-fpm-xdebug-remote'.
Codeception PHP Testing Framework v2.4.3
Powered by PHPUnit 6.5.9 by Sebastian Bergmann and contributors.

Unit Tests (6) ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
- ActionsTest: Run job as class methodWorker process starting with PID 23383 ...
Process 23383 are working...
Process 23383 finished
✔ ActionsTest: Run job as class method (0.15s)
- ActionsTest: Run job class static methodWorker process starting with PID 23383 ...
Process 23383 are working...
Process 23383 finished
✔ ActionsTest: Run job class static method (0.04s)
- ActionsTest: Run job as action of controllerWorker process starting with PID 23383 ...
Process 23383 are working...
Process 23383 finished
✔ ActionsTest: Run job as action of controller (0.05s)
- ActionsTest: Run job as static methodWorker process starting with PID 23383 ...
Process 23383 are working...
Process 23383 finished
✔ ActionsTest: Run job as static method (0.04s)
- FileTest: Job as class methodWorker process starting with PID 23383 ...
Process 23383 are working...
Process 23383 finished
✔ FileTest: Job as class method (0.03s)
- RedisTest: Job as classWorker process starting with PID 23383 ...
Process 23383 are working...
Process 23383 finished
✔ RedisTest: Job as class (0.03s)
-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Time: 1.34 seconds, Memory: 16.00MB
```

License
=======

[](#license)

[![FOSSA Status](https://camo.githubusercontent.com/3c921643891bd7c017559fe0941f5d85485744caade07167c5993f5139a23443/68747470733a2f2f6170702e666f7373612e696f2f6170692f70726f6a656374732f6769742532426769746875622e636f6d2532464d69726f636f77253246796969322d71756575652e7376673f747970653d6c61726765)](https://app.fossa.io/projects/git%2Bgithub.com%2FMirocow%2Fyii2-queue?ref=badge_large)

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community15

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 54.4% 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 ~244 days

Total

4

Last Release

2863d ago

Major Versions

0.0.3 → 1.0.02018-07-10

PHP version history (2 changes)0.0.3PHP &gt;=5.4

1.0.0PHP &gt;=7.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/b153b4b289b4cae263a6422fc4b660bb6b78392637914110f62a905d389656df?d=identicon)[Mirocow](/maintainers/Mirocow)

---

Top Contributors

[![Mirocow](https://avatars.githubusercontent.com/u/376396?v=4)](https://github.com/Mirocow "Mirocow (56 commits)")[![creocoder](https://avatars.githubusercontent.com/u/896494?v=4)](https://github.com/creocoder "creocoder (37 commits)")[![argayash](https://avatars.githubusercontent.com/u/790535?v=4)](https://github.com/argayash "argayash (8 commits)")[![samdark](https://avatars.githubusercontent.com/u/47294?v=4)](https://github.com/samdark "samdark (2 commits)")

---

Tags

amphpforknonblockingqueueserveryii2queueyii2

### Embed Badge

![Health badge](/badges/mirocow-yii2-queue/health.svg)

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

###  Alternatives

[trntv/yii2-command-bus

Yii2 Command Bus extension

57625.1k8](/packages/trntv-yii2-command-bus)[ignatenkovnikita/yii2-queuemanager

Yii2 Queue Manager

2061.8k2](/packages/ignatenkovnikita-yii2-queuemanager)

PHPackages © 2026

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