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

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

micmorozov/yii2-gearman
=======================

Gearman handler for PHP (fork)

15.8k3[1 PRs](https://github.com/micmorozov/yii2-gearman/pulls)PHP

Since Jul 26Pushed 8y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (2)Used By (0)

yii2-gearman
============

[](#yii2-gearman)

This extension built on [this](https://github.com/Filsh/yii2-gearman) and [this](https://github.com/sinergi/gearman) and [this](https://github.com/shakura/yii2-gearman)The goal of the project is opportunity of starting multiple worker processes on one machine. Work only as process(fork). In config you can set count of nodes, look 'Configuration'

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

[](#installation)

It is recommended that you install the Gearman library [through composer](http://getcomposer.org/). To do so, add the following lines to your `composer.json` file.

```
{
    "require": {
       "micmorozov/yii2-gearman": "dev-master"
    }
}
```

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

[](#configuration)

```
'components' => [
  'gearman' => [
      'class' => 'micmorozov\yii2\gearman\GearmanComponent',
      'servers' => [
          ['host' => '127.0.0.1', 'port' => 4730],
      ],
      'user' => 'www-data',
      'jobs' => [
          'syncCalendar' => [
              'class' => 'common\jobs\SyncCalendar',
              'count'=>10 // default count 1
          ],
          ...
      ]
  ]
],
...
'controllerMap' => [
    'gearman' => [
        'class' => 'micmorozov\yii2\gearman\GearmanController',
        'gearmanComponent' => 'gearman',
    ],
    ...
],
```

Job example
-----------

[](#job-example)

```
namespace common\jobs;

use micmorozov\yii2-gearman\JobBase;

class SyncCalendar extends JobBase
{
    public function execute(\GearmanJob $job = null)
    {
        // Do something
    }
}
```

Manage workers
--------------

[](#manage-workers)

```
yii gearman/start  // start the worker
yii gearman/restart  // restart worker
yii gearman/stop // stop worker
```

Example using Dispatcher
------------------------

[](#example-using-dispatcher)

```
Yii::$app->gearman->getDispatcher()->background('syncCalendar', new JobWorkload([
    'params' => [
        'data' => 'value'
    ]
])); // run in background
Yii::$app->gearman->getDispatcher()->execute('syncCalendar', new JobWorkload([
    'params' => [
        'data' => 'value'
    ]
])); // run synchronize
```

Example of [Supervisor](http://supervisord.org/) config to manage multiple workers
----------------------------------------------------------------------------------

[](#example-of-supervisor-config-to-manage-multiple-workers)

```
[program:yii-gearman-worker]
command=php [path_to_your_app]/yii gearman/start %(process_num)s
process_name=gearman-worker-%(process_num)s
priority=1
numprocs=5
numprocs_start=1
autorestart=true

```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity21

Limited adoption so far

Community14

Small or concentrated contributor base

Maturity43

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/502ef08a062832df3a3bf9f8e9c3add56ea2247b3c838661e5812c765c36d951?d=identicon)[micmorozov](/maintainers/micmorozov)

---

Top Contributors

[![micmorozov](https://avatars.githubusercontent.com/u/1742566?v=4)](https://github.com/micmorozov "micmorozov (7 commits)")[![shakura](https://avatars.githubusercontent.com/u/9025388?v=4)](https://github.com/shakura "shakura (7 commits)")[![vov4ik08](https://avatars.githubusercontent.com/u/2761022?v=4)](https://github.com/vov4ik08 "vov4ik08 (7 commits)")[![ferrumfist](https://avatars.githubusercontent.com/u/14904438?v=4)](https://github.com/ferrumfist "ferrumfist (4 commits)")

### Embed Badge

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

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

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.5M30](/packages/league-geotools)[illuminate/bus

The Illuminate Bus package.

6045.5M513](/packages/illuminate-bus)[uecode/qpush-bundle

Asynchronous processing for Symfony using Push Queues

1672.5M2](/packages/uecode-qpush-bundle)[mayconbordin/l5-stomp-queue

Stomp Queue Driver for Laravel 5

121.1k](/packages/mayconbordin-l5-stomp-queue)

PHPackages © 2026

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