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

ActiveLibrary

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 today

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 35% 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

3572d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/81832b7ce373292df19cf8083a15a64210e41ecac3cd8184d80d9c81a85d86d1?d=identicon)[fgh151](/maintainers/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

[fedemotta/yii2-widget-datatables

DataTables widget for Yii2

36177.8k1](/packages/fedemotta-yii2-widget-datatables)[prawee/yii2-vuejs

Vue.js library for Yii2

1712.1k](/packages/prawee-yii2-vuejs)

PHPackages © 2026

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