PHPackages                             fgh151/yii2-beanstalk-singleton - 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. fgh151/yii2-beanstalk-singleton

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

fgh151/yii2-beanstalk-singleton
===============================

Trait for only one instance of beanstalk worker

v0.0.2(9y ago)020MITPHP

Since Jun 10Pushed 9y ago1 watchersCompare

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

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

Yii2 beanstalk singleton trait
==============================

[](#yii2-beanstalk-singleton-trait)

Trait for only one instance of beanstalk worker

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

[](#installation)

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

Either run

```
php composer.phar require --prefer-dist fgh151/yii2-beanstalk-singleton "*"

```

or add

```
"fgh151/yii2-beanstalk-singleton": "*"

```

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

Usage
-----

[](#usage)

Once the extension is installed, add trait to beanstalk controller

```
class TestController extends udokmeci\yii2beanstalk\BeanstalkController
{
    use fgh151\beanstalk\Singleton;

}
```

Now you have additional commands:

```
./yii test/status
```

it will print pid of current process or "Not active" if worker not run

```
./yii test/halt
```

it will halt current worker

PHP &gt;= 5.4
-------------

[](#php--54)

If you use php &gt;= 5.4, you mas override \_\_construct and \_\_destruct methods:

```
class BuildController extends BeanstalkController
{
    use fgh151\beanstalk\Singleton {
        Singleton::__construct as private __TraitConstruct;
        Singleton::__destruct as private __TraitDestruct;
    }

    public function __construct($id, Module $module, array $config)
    {
        $this->__TraitConstruct($id, $module, $config);
    }

    public function __destruct()
    {
        $this->__TraitDestruct();
    }
}
```

###  Health Score

24

—

LowBetter than 32% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity54

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

Total

2

Last Release

3623d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/645524?v=4)[Fedor Gorsky](/maintainers/fgh151)[@fgh151](https://github.com/fgh151)

---

Top Contributors

[![fgh151](https://avatars.githubusercontent.com/u/645524?v=4)](https://github.com/fgh151 "fgh151 (3 commits)")

---

Tags

libraryyii2singletonbeanstalk

### Embed Badge

![Health badge](/badges/fgh151-yii2-beanstalk-singleton/health.svg)

```
[![Health](https://phpackages.com/badges/fgh151-yii2-beanstalk-singleton/health.svg)](https://phpackages.com/packages/fgh151-yii2-beanstalk-singleton)
```

###  Alternatives

[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)[udokmeci/yii2-beanstalk

Yii2 Beanstalk Client at the top of Paul Annesley's pheanstalk

69125.3k3](/packages/udokmeci-yii2-beanstalk)[bubasuma/yii2-simplechat

A simple chat for your yii2 application

889.5k](/packages/bubasuma-yii2-simplechat)[ignatenkovnikita/yii2-queuemanager

Yii2 Queue Manager

2061.8k2](/packages/ignatenkovnikita-yii2-queuemanager)

PHPackages © 2026

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