PHPackages                             nonfishz/multi-process-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. nonfishz/multi-process-worker

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

nonfishz/multi-process-worker
=============================

multi process do tasks easily

00

Since Sep 21Pushed 3y agoCompare

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

READMEChangelogDependenciesVersions (1)Used By (0)

 muti process worker
=====================

[](#--muti-process-worker-)

 use muti process worker do tasks quickily and easily.

Introduction
------------

[](#introduction)

provide child process work space ,you can do task in child work space in onWork function . also it provide functions to get work content quickily and easily ,you can see `MultiProcessWorker::getWorkContentByIdMode` and `MultiProcessWorker::getWorkContentByOffsetMode`

Requires
--------

[](#requires)

- php &gt; 7.1.3
- ext-pcntl enabled
- ext-swoole optional

Installing
----------

[](#installing)

```
$ composer require nonfishz/multi-process-worker
```

Usage
-----

[](#usage)

```
use Nonfishz\MultiProcessWorker\MultiProcessWorker;

$workNum = 4;
$worker = new MultiProcessWorker($workNum, MultiProcessWorker::modePcntl);
//$worker = new MultiProcessWorker($workNum, MultiProcessWorker::modeSwooleProcess);
$worker->onWork = function ($workPage, $pid) use ($workNum) {
    echo PHP_EOL;
    echo "工作空间编号:{$workPage},进程id:{$pid}" . PHP_EOL;

    //提供便捷函数，快速获得任务内容 ，模式一：id模式
    list($beginId, $endId, $isLastWorkPage) = MultiProcessWorker::getWorkContentByIdMode($workPage, 4, 1, 100001);
    //  select * from xxx where id >={$beginId} AND id start();
```

Contributing
------------

[](#contributing)

github.com:cr-mao/multi-process-worker You can contribute in one of three ways:

1. File bug reports using the [issue tracker](https://github.com/cr-mao/multi-process-worker/issues).
2. Answer questions or fix bugs on the [issue tracker](https://github.com/cr-mao/multi-process-worker/issues).
3. Contribute new features or update the wiki.

*The code contribution process is not very formal. You just need to make sure that you follow the PSR-0, PSR-1, and PSR-2 coding guidelines. Any new code contributions must be accompanied by unit tests where applicable.*

License
-------

[](#license)

MIT

Links
-----

[](#links)

-
-
-

###  Health Score

13

—

LowBetter than 1% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity0

Limited adoption so far

Community2

Small or concentrated contributor base

Maturity25

Early-stage or recently created project

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/11ca1ad300c3560b968b67e6cce83dcfdde238fa970d74916d91a7c5f72dbac0?d=identicon)[nonfishz](/maintainers/nonfishz)

### Embed Badge

![Health badge](/badges/nonfishz-multi-process-worker/health.svg)

```
[![Health](https://phpackages.com/badges/nonfishz-multi-process-worker/health.svg)](https://phpackages.com/packages/nonfishz-multi-process-worker)
```

###  Alternatives

[league/geotools

Geo-related tools PHP 7.3+ library

1.4k5.3M26](/packages/league-geotools)[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

2228.8M171](/packages/react-async)[react/promise-stream

The missing link between Promise-land and Stream-land for ReactPHP

11512.9M45](/packages/react-promise-stream)[illuminate/bus

The Illuminate Bus package.

6043.8M409](/packages/illuminate-bus)

PHPackages © 2026

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