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

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

wayhood/yii2-queue
==================

yii2 queue component

1626.5k↓30.8%10[3 issues](https://github.com/wayhood/yii2-queue/issues)PHP

Since Jan 3Pushed 10y ago5 watchersCompare

[ Source](https://github.com/wayhood/yii2-queue)[ Packagist](https://packagist.org/packages/wayhood/yii2-queue)[ RSS](/packages/wayhood-yii2-queue/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (1)Used By (0)

Queue component for Yii2
========================

[](#queue-component-for-yii2)

This component provides simple queue wrapper

I recommend [yii2-asynctask](https://github.com/wayhood/yii2-asynctask).

Requirements
------------

[](#requirements)

[Redis](http://redis.io)[yii2-redis](https://github.com/yiisoft/yii2-redis)

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

[](#installation)

The preferred way to install this extension is through [composer](http://getcomposer.org/download/).

Either run

```
php composer.phar require --prefer-dist wayhood/yii2-queue "*"

```

or add

```
"wayhood/yii2-queue": "*"

```

to the require section of your `composer.json` file.

Usage
-----

[](#usage)

To use this extension, simply add the following code in your application configuration:

```
return [
    //....
    'components' => [
        'queue' => [
            'class' => 'wh\queue\RedisQueue',
        ],
        'redis' => [
            'class' => 'yii\redis\Connection',
            'hostname' => 'localhost',
            'port' => 6379,
            'database' => 0
        ],
    ],
];
```

First create a Job process class

```
namespace console\jobs;

class MyJob
{
    public function run($job, $data)
    {
        //process $data;
        var_dump($data);
    }
}
```

and than just push job to queue

```
// Push job to the default queue and execute "run" method
Yii::$app->queue->push('\console\jobs\MyJob', ['a', 'b', 'c']);

// or push it and execute any other method
Yii::$app->queue->push('\console\jobs\MyJob@myMethod', ['a', 'b', 'c']);

// or push it to some specific queue
Yii::$app->queue->push('\console\jobs\MyJob', ['a', 'b', 'c'], 'myQueue');

// or both
Yii::$app->queue->push('\console\jobs\MyJob@myMethod', ['a', 'b', 'c'], 'myQueue');
```

Map console controller in your app config

```
return [
    ...
    'controllerMap' => [
        'queue' => 'wh\queue\console\controllers\QueueController'
    ],
    ...
];
```

Examples of using queue controller:

```
# Process a job from default queue and than exit the process
./yii queue/work

# continuously process jobs from default queue
./yii queue/listen

# process a job from specific queue and than exit the process
./yii queue/work myQueue

# continuously process jobs from specific queue
./yii queue/listen myQueue

```

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance16

Infrequent updates — may be unmaintained

Popularity37

Limited adoption so far

Community19

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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.

### Community

Maintainers

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

---

Top Contributors

[![mikk150](https://avatars.githubusercontent.com/u/4953629?v=4)](https://github.com/mikk150 "mikk150 (4 commits)")[![bryglen](https://avatars.githubusercontent.com/u/875604?v=4)](https://github.com/bryglen "bryglen (2 commits)")[![chebureque](https://avatars.githubusercontent.com/u/1630226?v=4)](https://github.com/chebureque "chebureque (1 commits)")[![lichunqiang](https://avatars.githubusercontent.com/u/2433916?v=4)](https://github.com/lichunqiang "lichunqiang (1 commits)")[![lynicidn](https://avatars.githubusercontent.com/u/7407411?v=4)](https://github.com/lynicidn "lynicidn (1 commits)")[![tsacks](https://avatars.githubusercontent.com/u/2553898?v=4)](https://github.com/tsacks "tsacks (1 commits)")

### Embed Badge

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

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

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.3M26](/packages/league-geotools)[enqueue/enqueue

Message Queue Library

19820.0M56](/packages/enqueue-enqueue)[deliciousbrains/wp-background-processing

WP Background Processing can be used to fire off non-blocking asynchronous requests or as a background processing tool, allowing you to queue tasks.

1.1k409.8k6](/packages/deliciousbrains-wp-background-processing)[react/async

Async utilities and fibers for ReactPHP

2228.8M171](/packages/react-async)[react/promise-stream

The missing link between Promise-land and Stream-land for ReactPHP

11512.9M45](/packages/react-promise-stream)[illuminate/bus

The Illuminate Bus package.

6043.8M409](/packages/illuminate-bus)

PHPackages © 2026

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