PHPackages                             lisio/yii2-mongodb-q - 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. [Database &amp; ORM](/categories/database)
4. /
5. lisio/yii2-mongodb-q

ActiveYii2-extension[Database &amp; ORM](/categories/database)

lisio/yii2-mongodb-q
====================

MongoDB Queue Server extension for the Yii framework

1.0.5(5y ago)133BSD-3-ClausePHPPHP &gt;=7.1.0

Since Aug 7Pushed 5y ago1 watchersCompare

[ Source](https://github.com/Lisio/yii2-mongodb-q)[ Packagist](https://packagist.org/packages/lisio/yii2-mongodb-q)[ RSS](/packages/lisio-yii2-mongodb-q/feed)WikiDiscussions master Synced today

READMEChangelogDependencies (4)Versions (6)Used By (0)

MongoDB Queue Server extension for Yii2
=======================================

[](#mongodb-queue-server-extension-for-yii2)

This extension allow to use MongoDB as queue server without bloating project's stack and provides GUI.

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

[](#installation)

This extension requires MongoDB server version 3.6 or higher. The preferred way to install this extension is through [composer](http://getcomposer.org/download/). Either run

```
php composer.phar require --prefer-dist lisio/yii2-mongodb-q

```

or add

```
"lisio/yii2-mongodb-q": "~1.0.0"

```

to the require section of your composer.json.

Configuration
-------------

[](#configuration)

To use this extension, add the following code to application web configuration:

```
return [
    // ...
    'bootstrap' => [
        // ...,
        'q',
    ],
    'components' => [
        // ...
        'queue' => [
            'class' => '\yii\q\components\QueueServer',
        ],
    ],
    'modules' => [
        // ...
        'q' => [
            'class' => 'yii\q\Module',
        ],
    ],
];
```

And to application console configuration:

```
return [
    // ...
    'controllerMap' => [
        // ...
        'q' => 'yii\q\commands\QueueController',
    ],
    'components' => [
        // ...
        'queue' => [
            'class' => '\yii\q\components\QueueServer',
        ],
    ],
];
```

Create indexes:

```
./yii q/create-indexes
```

Usage
-----

[](#usage)

This extension provides sample code for different cases (see folder `examples/`).

### Create queue

[](#create-queue)

```
Yii::$app->queue->queueCreate('test');
```

### Purge queue

[](#purge-queue)

```
Yii::$app->queue->queuePurge('test');
```

### Remove queue

[](#remove-queue)

```
Yii::$app->queue->queueRemove('test');
```

### Create job

[](#create-job)

```
$data = [
    'someParam' => 'someValue',
];

$options = [
    'keepResult' => true,
    'keepResultDuration' => 86400,
];

$job = Yii::$app->queue->jobCreate('test', SomeWorker::className(), $data, $options);
```

### Pause job

[](#pause-job)

```
Yii::$app->queue->jobPause($job->_id);
```

### Resume job

[](#resume-job)

```
Yii::$app->queue->jobResume($job->_id);
```

### Remove job

[](#remove-job)

```
Yii::$app->queue->jobRemove($job->_id);
```

### Retry failed job

[](#retry-failed-job)

```
Yii::$app->queue->jobRetry($job->_id);
```

### Get job data

[](#get-job-data)

```
Yii::$app->queue->jobStatus($job->_id);
```

### Spawn worker and bind it to all queues

[](#spawn-worker-and-bind-it-to-all-queues)

```
./yii q/spawn

```

### Spawn 3 workers and bind them to queues `download` and `report`

[](#spawn-3-workers-and-bind-them-to-queues-download-and-report)

```
./yii q/spawn 3 download,report

```

### Remove dead workers which processes are not found at this host

[](#remove-dead-workers-which-processes-are-not-found-at-this-host)

```
./yii q/remove-dead-workers

```

### Remove stale jobs which keepResultDuration is passed

[](#remove-stale-jobs-which-keepresultduration-is-passed)

```
./yii q/remove-stale-jobs

```

### Stop workers bound to queues `download` and `report`

[](#stop-workers-bound-to-queues-download-and-report)

```
./yii q/stop-workers download,report

```

### Stop workers bound to all queues (notice how it differs from stopping all workers)

[](#stop-workers-bound-to-all-queues-notice-how-it-differs-from-stopping-all-workers)

```
./yii q/stop-workers

```

### Stop all workers

[](#stop-all-workers)

```
./yii q/stop-all-workers

```

GUI
---

[](#gui)

GUI can be accessed at .

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~164 days

Total

5

Last Release

2177d ago

PHP version history (2 changes)1.0.1PHP &gt;=7.0.0

1.0.5PHP &gt;=7.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/9c5eac9c3baf0a33a094cb755ca3f67a18b64739c9222eeb459b0599fbc8c37f?d=identicon)[Lisio](/maintainers/Lisio)

---

Top Contributors

[![Lisio](https://avatars.githubusercontent.com/u/1868244?v=4)](https://github.com/Lisio "Lisio (11 commits)")

---

Tags

queuemongodbyii2

### Embed Badge

![Health badge](/badges/lisio-yii2-mongodb-q/health.svg)

```
[![Health](https://phpackages.com/badges/lisio-yii2-mongodb-q/health.svg)](https://phpackages.com/packages/lisio-yii2-mongodb-q)
```

###  Alternatives

[letyii/yii2-rbac-mongodb

RBAC Mongodb for Yiiframework 2

114.4k1](/packages/letyii-yii2-rbac-mongodb)

PHPackages © 2026

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