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

ActiveLibrary

cr-mao/multi-process-worker
===========================

multi process do tasks easily

1.0.0(4y ago)270MITPHPPHP ^7.1.3

Since Jun 6Pushed 4y ago1 watchersCompare

[ Source](https://github.com/cr-mao/multi-process-worker)[ Packagist](https://packagist.org/packages/cr-mao/multi-process-worker)[ RSS](/packages/cr-mao-multi-process-worker/feed)WikiDiscussions main Synced 5d ago

READMEChangelog (1)DependenciesVersions (3)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 cr-mao/multi-process-worker
```

Usage
-----

[](#usage)

```
use Crmao\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

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity11

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity48

Maturing project, gaining track record

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

Total

2

Last Release

1796d ago

Major Versions

0.0.1 → 1.0.02021-06-16

### Community

Maintainers

![](https://www.gravatar.com/avatar/c796c5e9daf20c50d3b5d02fd89087a559132cd5b0109df82ea78339b29f9182?d=identicon)[cr-mao](/maintainers/cr-mao)

---

Tags

multi-processpcntlphp-processswooleswoole-process

### Embed Badge

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

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

PHPackages © 2026

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