PHPackages                             perspectivain/yii2-gearman - 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. perspectivain/yii2-gearman

ActiveLibrary[Queues &amp; Workers](/categories/queues)

perspectivain/yii2-gearman
==========================

Consumer for gearman server

02791PHP

Since Mar 21Pushed 11y ago4 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

Yii2 Gearman
============

[](#yii2-gearman)

Component for use gearman server as consumer jobs

Deprecated if Yii2 Queue Component ([yiisoft/yii2#492](https://github.com/yiisoft/yii2/issues/492)) was accepted

Simple Usage
============

[](#simple-usage)

Register a component

```
'components' => [
    'gearman' => [
        'class' => 'perspectivain\gearman\Gearman',
        'jobsNamespace' => '\app\jobs\\',
        'servers' => [
            ['host' => GEARMAN_SERVER_HOST, 'port' => GEARMAN_SERVER_PORT],
        ],
    ],
    ...
],

```

Register a command controller

```
'controllerMap' => [
    'worker' => [
        'class' => 'perspectivain\gearman\WorkerController'
    ],
    ...
]

```

Create an job class

```
namespace app\jobs;

class MyJob implements perspectivain\gearman\InterfaceJob
{
    /**
     * @inheritdoc
     */
    public function run($attributes)
    {
        //do something
    }
}

```

Register an job in your application

```
\perspectivain\gearman\BackgroundJob::register('GearmanJob', ['attributeA' => 10]);

```

Run the worker

```
# php yii worker/run-one

```

If your need continuous worker, use the crontab or the supervisor process control system ().

Multi queue Usage
=================

[](#multi-queue-usage)

Register an job in your application

```
$queueName = 'newqueue';
\perspectivain\gearman\BackgroundJob::register('GearmanJob', ['attributeA' => 10], \perspectivain\gearman\BackgroundJob::NORMAL, $queueName);

```

Run the worker

```
# php yii worker/run-one newqueue

```

Installing
==========

[](#installing)

The preferred way to install this extension is through composer.

```
{
  "require": {
    "perspectivain/yii2-gearman": "*"
  }
}

```

###  Health Score

22

—

LowBetter than 22% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity12

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity41

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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/91f1601b0d5df44b7f4008beed1206c8fde96a7cd31145270a53268d57ef09c0?d=identicon)[jsopra](/maintainers/jsopra)

---

Top Contributors

[![jsopra](https://avatars.githubusercontent.com/u/822175?v=4)](https://github.com/jsopra "jsopra (14 commits)")

### Embed Badge

![Health badge](/badges/perspectivain-yii2-gearman/health.svg)

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

###  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)
