PHPackages                             kirillreutski/php-worker - 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. kirillreutski/php-worker

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

kirillreutski/php-worker
========================

Generic PHP worker. DB Agnostic. CRON required (or any other scheduler

v0.2.3.2(3y ago)025PHP

Since Apr 1Pushed 3y ago1 watchersCompare

[ Source](https://github.com/kirillreutski/php-worker)[ Packagist](https://packagist.org/packages/kirillreutski/php-worker)[ RSS](/packages/kirillreutski-php-worker/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (9)DependenciesVersions (10)Used By (0)

todo
====

[](#todo)

1. Rebuild status updating — not only with suspend

php-worker
==========

[](#php-worker)

Your worker class should extend \\kirillreutski\\PhpWorker\\GenericWorker. Override methods: public static function addLog(string $text): void; public function updateStatus(string $newStatus): void; // method called each time when we need to update status in e.g. DB public function saveState(); //function called when worker finished and we need to store its data e.g. in DB

The definition of worker steps is set in constructor:

public function \_\_construct(array $wr) {

```
static::$steps = [
    Step::instant('firstStep'),
    Step::instant('secondStep'),
    /* here script stops till next run*/
    Step::long('thirdStep'),
    Step::instant('forthStep')
];

parent::__construct($wr);

```

}

Step is an object of type kirillreutski\\PhpWorker\\Step; Worker class should contain a non-static funciton with the same name.

To run a worker, do: $worker = Custom\\RealWorker::init(\[...\]); $worker-&gt;run();

Also process runner implemented which picks a first task to be run: $worker = Custom\\ProcessRunner::runNext(); ProcessRunner extends GenericProcessRunner and overrides public static function getProcessList (returns array of tasks)

Worker expects the following data in passed array: \[ 'current\_step' =&gt; CURRENT\_STEP\_NAME, // step from which we start 'data' =&gt; \[\], // data "storage" — there your steps store execution data if needed 'handling\_status' =&gt; CURRENT\_WORKER\_STATUS, //awaitingNextRun, inProgress, done \]

Instant steps are done one by one in a single run. When worker faces 'long' step — and if it is not a first step in a current run — then it suspends. Otherwise it runs currespondent step and if this step returns true — then we go to next step; if false — suspend and step remains the same;

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity40

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

9

Last Release

1134d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/8730d322cf421c19e68fea9c584e3bc93ec3b8b3e78d7ed4a027e333a6797825?d=identicon)[kirillreutski](/maintainers/kirillreutski)

---

Top Contributors

[![kirillreutski](https://avatars.githubusercontent.com/u/46716839?v=4)](https://github.com/kirillreutski "kirillreutski (1 commits)")

### Embed Badge

![Health badge](/badges/kirillreutski-php-worker/health.svg)

```
[![Health](https://phpackages.com/badges/kirillreutski-php-worker/health.svg)](https://phpackages.com/packages/kirillreutski-php-worker)
```

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.3M26](/packages/league-geotools)[amphp/parser

A generator parser to make streaming parsers simple.

14952.8M16](/packages/amphp-parser)[amphp/serialization

Serialization tools for IPC and data storage in PHP.

13451.1M18](/packages/amphp-serialization)[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

2238.8M170](/packages/react-async)

PHPackages © 2026

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