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

ActiveYii-extension

micmorozov/yii-gearman
======================

Gearman handler for PHP (fork)

0589PHP

Since Sep 26Pushed 2y ago1 watchersCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

yii-gearman
===========

[](#yii-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": {
       "ferrumfist/yii-gearman": "dev-master"
    }
}
```

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

[](#configuration)

```
'components' => [
  'gearman' => [
      'class' => 'ferrumfist\yii\gearman\src\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' => 'ferrumfist\yii\gearman\src\GearmanController',
        'gearmanComponent' => 'gearman',
    ],
    ...
],
```

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

[](#job-example)

```
namespace common\jobs;

use ferrumfist\yii-gearman\JobBase;

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

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

17

—

LowBetter than 8% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity15

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity20

Early-stage or recently created project

 Bus Factor1

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

---

Top Contributors

[![micmorozov](https://avatars.githubusercontent.com/u/1742566?v=4)](https://github.com/micmorozov "micmorozov (14 commits)")[![ferrumfist](https://avatars.githubusercontent.com/u/14904438?v=4)](https://github.com/ferrumfist "ferrumfist (13 commits)")

### Embed Badge

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

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

PHPackages © 2026

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