PHPackages                             yuyue8/tp\_queue - 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. yuyue8/tp\_queue

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

yuyue8/tp\_queue
================

thinkphp queue

v1.0.9(2y ago)0342Apache-2.0PHPPHP &gt;=8.0.2

Since May 29Pushed 2y ago1 watchersCompare

[ Source](https://github.com/yuyue8/tp_queue)[ Packagist](https://packagist.org/packages/yuyue8/tp_queue)[ RSS](/packages/yuyue8-tp-queue/feed)WikiDiscussions master Synced 2mo ago

READMEChangelog (8)Dependencies (2)Versions (10)Used By (2)

TpQueue
=======

[](#tpqueue)

安装
--

[](#安装)

```
composer require yuyue8/tp_queue

```

使用方法
----

[](#使用方法)

默认使用 `Yuyue8\TpQueue\basic\BaseJobs` 类执行任务，若需自定义执行类， 只需继承 `Yuyue8\TpQueue\basic\BaseJobs` 类，并重置 `fire` 方法， 然后在`tp_config`配置文件中添加 `base_jobs_class` 参数，值为自定义类

例如：

```
'base_jobs_class' => \app\basic\Job::class

```

然后创建 `jobs` 类

```
php think make:jobs /data/jobs/Sms

```

> 在 `jobs` 类中，返回 `true` 表示消费成功，其他返回值表示消费失败，将会进入重新投递，重新投递次数用完依然没有消费成功，删除此消息，并执行 `JobsFailListener` 事件, `JobsFailListener` 该事件需要自己创建并注册

使用方法如下：

```
/** @var Sms $job */
$job = app(Sms::class);
$job->dispatch(['参数1','参数2'...]);
$job->dispatchSece('延迟时间',['参数1','参数2'...]);
$job->dispatchDo('执行方法名',['参数1','参数2'...],'延长时间');
```

监听任务并执行
-------

[](#监听任务并执行)

```
&> php think queue:listen
php think queue:listen --queue Sms

&> php think queue:work
```

###  Health Score

25

—

LowBetter than 37% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community11

Small or concentrated contributor base

Maturity55

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

Recently: every ~72 days

Total

9

Last Release

795d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/53282d9e2a3bfccaf3b02ed4e2f1ede03c83141441299709b10a47d6392cc25a?d=identicon)[yuyue8](/maintainers/yuyue8)

---

Top Contributors

[![yuyue8](https://avatars.githubusercontent.com/u/48197835?v=4)](https://github.com/yuyue8 "yuyue8 (10 commits)")

### Embed Badge

![Health badge](/badges/yuyue8-tp-queue/health.svg)

```
[![Health](https://phpackages.com/badges/yuyue8-tp-queue/health.svg)](https://phpackages.com/packages/yuyue8-tp-queue)
```

###  Alternatives

[topthink/think-queue

The ThinkPHP6 Queue Package

640675.0k75](/packages/topthink-think-queue)

PHPackages © 2026

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