PHPackages                             misuoka/work-loop - 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. misuoka/work-loop

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

misuoka/work-loop
=================

循环执行任务的后台服务程序 Background service program that executes tasks cyclically

v0.1.0(3y ago)04MITPHPPHP &gt;=7.0

Since Nov 11Pushed 3y ago1 watchersCompare

[ Source](https://github.com/misuoka/work-loop)[ Packagist](https://packagist.org/packages/misuoka/work-loop)[ RSS](/packages/misuoka-work-loop/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (2)Used By (0)

work-loop
=========

[](#work-loop)

循环执行任务的后台服务程序

使用方法
----

[](#使用方法)

使用 composer 进行安装 `composer require misuoka/work-loop`。

按如下配置执行脚本，在 **workers** 数组里配置具体的业务代码，业务类必须实现接口 `misuoka\WorkLoop\WorkInterface`。

```
# 假设文件：index.php

require(__DIR__ . '/../vendor/autoload.php');

use misuoka\WorkLoop\WorkGo;

$config = [
    'name'         => 'XXX服务后台业务程序', // 自定义项目名称
    'version'      => 'v1.0',              // 自定义项目版本
    'display_type' => 0, // UI形式。0：默认输出方式；1：重复刷新格式化的UI
    'workers' => [
        // 'workname' => [
        //     'enabled'      => true,  // 启用任务
        //     'logic'        => \app\logic\Xxxx::class, // 具体业务类，必须实现接口 misuoka\WorkLoop\WorkInterface
        //     'sleeptime'    => 0.3,   // 秒，支持小数。循环执行任务的休眠时间
        //     'working_time' => 10,    // 工作时长，单位分钟。进程循环执行的时间。时间到了之后，会再次启动进程
        // ],
    ],
];

$wd = new WorkGo($config);
$wd->run();
```

在脚本文件中配置完成后，在 shell 终端中执行如下命令。

```
# Usage: php script_name.php {start|restart|stop|help} [-d]
# -d 表示以守护进程的方式运行脚本
php script_name.php start
```

###  Health Score

17

—

LowBetter than 6% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity3

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity32

Early-stage or recently created project

 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

Unknown

Total

1

Last Release

1330d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/0051ad9a710fbffbe26540c10f0d9702be59bb0d1f9d9dea9f6b4603ecc7f935?d=identicon)[misuoka](/maintainers/misuoka)

---

Top Contributors

[![misuoka](https://avatars.githubusercontent.com/u/8513089?v=4)](https://github.com/misuoka "misuoka (2 commits)")

---

Tags

taskloopdaemonwork

### Embed Badge

![Health badge](/badges/misuoka-work-loop/health.svg)

```
[![Health](https://phpackages.com/badges/misuoka-work-loop/health.svg)](https://phpackages.com/packages/misuoka-work-loop)
```

###  Alternatives

[qxsch/worker-pool

Runs tasks in a parallel processing workerpool.

105328.2k1](/packages/qxsch-worker-pool)[iron-io/iron_worker

Client library for IronWorker (multi-language worker platform that runs tasks in the background, in parallel, and at scale.)

57210.5k1](/packages/iron-io-iron-worker)[tarantool/queue

PHP bindings for Tarantool Queue.

65137.6k4](/packages/tarantool-queue)[async-interop/event-loop

An event loop interface for interoperability.

1696.2k4](/packages/async-interop-event-loop)[orisai/scheduler

Cron job scheduler - with locks, parallelism and more

4044.1k5](/packages/orisai-scheduler)[g4/tasker

Application asynchronous tasks manager and runner, cron-like PHP implementation with ability to run tasks with resolution in seconds

1455.7k](/packages/g4-tasker)

PHPackages © 2026

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