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

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

mice-tm/yii2-queue
==================

Package base on yii2-queue with some improvements

0.1.0(8y ago)05.1k2MITPHPPHP &gt;=7.1.0

Since Oct 19Pushed 8y agoCompare

[ Source](https://github.com/mice-tm/yii2-queue)[ Packagist](https://packagist.org/packages/mice-tm/yii2-queue)[ RSS](/packages/mice-tm-yii2-queue/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (3)Versions (4)Used By (0)

Yii2 Queue Extension
====================

[](#yii2-queue-extension)

An extension for running tasks asyncronously via queues.

It supported queues based on **DB**, **Redis**, **RabbitMQ**, **Beanstalk** and **Gearman**.

Added delayed queue support for AMQP and health-checks for queues

Fork of

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

[](#installation)

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

Update composer.json

1. add to the require section of your `composer.json` file,

```
"mice-tm/yii2-queue": "dev-master"

```

2. then add a repositories section of your `composer.json` file.

```
{
  "type": "vcs",
  "url": "https://github.com/mice-tm/yii2-queue"
}

```

Basic Usage
-----------

[](#basic-usage)

Each task which is sent to queue should be defined as a separate class. For example, if you need to download and save a file the class may look like the following:

```
class DownloadJob extends Object implements \yii\queue\Job
{
    public $url;
    public $file;

    public function execute($queue)
    {
        file_put_contents($this->file, file_get_contents($this->url));
    }
}
```

Here's how to send a task into queue:

```
Yii::$app->queue->push(new DownloadJob([
    'url' => 'http://example.com/image.jpg',
    'file' => '/tmp/image.jpg',
]));
```

Pushes job into queue that run after 5 min:

```
Yii::$app->queue->delay(5 * 60)->push(new DownloadJob([
    'url' => 'http://example.com/image.jpg',
    'file' => '/tmp/image.jpg',
]));
```

The exact way task is executed depends on the driver used. The most part of drivers can be run using console commands, which the component registers in your application.

Command that obtains and executes tasks in a loop until queue is empty:

```
yii queue/run
```

Command launches a daemon which infinitely queries the queue:

```
yii queue/listen
```

See documentation for more details about driver console commands and their options.

The component has ability to track status of a job which was pushed into queue.

```
// Push a job into queue and get massage ID.
$id = Yii::$app->queue->push(new SomeJob());

// The job is waiting for execute.
Yii::$app->queue->isWaiting($id);

// Worker gets the job from queue, and executing it.
Yii::$app->queue->isReserved($id);

// Worker has executed the job.
Yii::$app->queue->isDone($id);
```

###  Health Score

27

—

LowBetter than 49% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity19

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity50

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.

###  Release Activity

Cadence

Every ~23 days

Total

3

Last Release

3079d ago

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

0.1.0PHP &gt;=7.1.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/067a37656b537e8fa47771627b5bc910a24f98db5e0b6e49e1f9df4345390731?d=identicon)[mice-tm](/maintainers/mice-tm)

---

Top Contributors

[![mice-tm](https://avatars.githubusercontent.com/u/24824170?v=4)](https://github.com/mice-tm "mice-tm (2 commits)")[![pyatachok](https://avatars.githubusercontent.com/u/2914352?v=4)](https://github.com/pyatachok "pyatachok (2 commits)")[![nikolaykovenko](https://avatars.githubusercontent.com/u/5886451?v=4)](https://github.com/nikolaykovenko "nikolaykovenko (1 commits)")

---

Tags

queueyii2AMQPdelayed queue

### Embed Badge

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

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

###  Alternatives

[bschmitt/laravel-amqp

AMQP wrapper for Laravel and Lumen to publish and consume messages

2752.3M7](/packages/bschmitt-laravel-amqp)[enqueue/amqp-lib

Message Queue Amqp Transport

1078.5M61](/packages/enqueue-amqp-lib)[trntv/yii2-command-bus

Yii2 Command Bus extension

57625.1k8](/packages/trntv-yii2-command-bus)[mikemadisonweb/yii2-rabbitmq

Wrapper based on php-amqplib to incorporate messaging in your Yii2 application via RabbitMQ. Inspired by RabbitMqBundle for Symfony 2, really awesome package.

74262.1k1](/packages/mikemadisonweb-yii2-rabbitmq)

PHPackages © 2026

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