PHPackages                             joshuakevin/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. [Caching](/categories/caching)
4. /
5. joshuakevin/yii2-queue

ActiveYii2-extension[Caching](/categories/caching)

joshuakevin/yii2-queue
======================

Yii2 Queue Extension which supported DB, Redis, RabbitMQ, Beanstalk and Gearman

1.0.1(8y ago)08.3kBSD-3-ClausePHPPHP &gt;=5.5.0

Since Dec 15Pushed 8y ago1 watchersCompare

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

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

 [ ![](https://avatars0.githubusercontent.com/u/993323) ](https://github.com/yiisoft)

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**.

Documentation is at [docs/guide/README.md](docs/guide/README.md).

[![Latest Stable Version](https://camo.githubusercontent.com/0d5e918086808ae4b4351d90e0c88df9035c1d4d721ce2753a532fef8e3c02be/68747470733a2f2f706f7365722e707567782e6f72672f796969736f66742f796969322d71756575652f762f737461626c652e737667)](https://packagist.org/packages/yiisoft/yii2-queue)[![Total Downloads](https://camo.githubusercontent.com/107ca7a75b24075d84b2c6794d5869d5563df59d02109bab198ca168faaa549c/68747470733a2f2f706f7365722e707567782e6f72672f796969736f66742f796969322d71756575652f646f776e6c6f6164732e737667)](https://packagist.org/packages/yiisoft/yii2-queue)[![Build Status](https://camo.githubusercontent.com/df0b5723f3db46691e2eae202e99d7b13ff04bf17e9ebf15384dcec9bc5c8177/68747470733a2f2f7472617669732d63692e6f72672f796969736f66742f796969322d71756575652e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/yiisoft/yii2-queue)

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist yiisoft/yii2-queue

```

or add

```
"yiisoft/yii2-queue": "~2.0.0"

```

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

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 BaseObject implements \yii\queue\JobInterface
{
    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 message 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);
```

For more details see [the guide](docs/guide/README.md).

###  Health Score

29

—

LowBetter than 60% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 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 ~2 days

Total

2

Last Release

3064d ago

### Community

Maintainers

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

---

Top Contributors

[![chan-mekari](https://avatars.githubusercontent.com/u/32836650?v=4)](https://github.com/chan-mekari "chan-mekari (1 commits)")

---

Tags

asyncredisqueuerabbitmqdbyiigiigearmanbeanstalk

###  Code Quality

TestsPHPUnit

### Embed Badge

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

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

###  Alternatives

[yiisoft/yii2-queue

Yii2 Queue Extension which supports queues based on DB, Redis, RabbitMQ, Beanstalk, SQS, and Gearman

1.1k10.4M154](/packages/yiisoft-yii2-queue)[enqueue/magento2-enqueue

Message Queue solutions for Magento2. Supports RabbitMQ, AMQP, STOMP, Amazon SQS, Kafka, Redis, Google PubSub, Gearman, Beanstalk, Google PubSub

4918.8k](/packages/enqueue-magento2-enqueue)[bazilio/yii2-async

Provides translucent api for moving large tasks out of request context

6248.8k2](/packages/bazilio-yii2-async)

PHPackages © 2026

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