PHPackages                             overnaive/think-swoole-crontab - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. overnaive/think-swoole-crontab

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

overnaive/think-swoole-crontab
==============================

A crontab component base on think-swoole.

v0.1.0(5y ago)0421MITPHPPHP ^7.1

Since Dec 17Pushed 5y ago1 watchersCompare

[ Source](https://github.com/OverNaive/think-swoole-crontab)[ Packagist](https://packagist.org/packages/overnaive/think-swoole-crontab)[ RSS](/packages/overnaive-think-swoole-crontab/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (1)Dependencies (2)Versions (2)Used By (0)

think-swoole-crontab
====================

[](#think-swoole-crontab)

A crontab component base on think-swoole.

声明
--

[](#声明)

核心逻辑来自于 [Hyperf](https://hyperf.io) 的 [hyperf/crontab](https://github.com/hyperf/crontab) 组件。非常感谢 Hyperf 为大家提供这么优的组件。

本组件试图让其运行在 ThinkPHP 里（需结合 [think-swoole](https://github.com/top-think/think-swoole) 组件）。

目前还处于初步可用阶段，后续会慢慢完善。

Requirement
-----------

[](#requirement)

- PHP &gt;= 7.1
- [Composer](https://getcomposer.org/)

Installation
------------

[](#installation)

`composer require overnaive/think-swoole-crontab`

Documents
---------

[](#documents)

- [swoole](https://wiki.swoole.com/#/)
- [hyperf/crontab](https://hyperf.wiki/2.0/#/zh-cn/crontab?id=%e5%ae%9a%e6%97%b6%e4%bb%bb%e5%8a%a1)

Usage
-----

[](#usage)

1. 在 `event.php` 里为 `swoole.init` 事件添加监听类。

```
return [
...
    'listem' => [
        ...
        'swoole.init' => [
            ...
            \ThinkSwooleCrontab\Process\CrontabDispatcherProcess::class,
            ...
        ],
        ...
    ],
...
];

```

2. 在配置文件 `crontab.php` 里添加 `\ThinkSwooleCrontab\Crontab` 实例。

```
return [
    'crontab' => [
        (new \ThinkSwooleCrontab\Crontab())->setName('test-1')
            ->setRule('* * * * * *')
            ->setCallback([Test::class, 'run'])
            ->setMemo('just a test crontab'),
        (new \ThinkSwooleCrontab\Crontab())->setName('test-2')
            ->setRule('* * * * * *')
            ->setCallback([Test::class, 'run'])
            ->setMemo('just another test crontab'),
    ],
];

```

License
-------

[](#license)

MIT

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity9

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity38

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

1972d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/3a57e49dd6e87757db50b8bb89cb4ff0d8431b285150a31f558475b15016908c?d=identicon)[OverNaive](/maintainers/OverNaive)

---

Top Contributors

[![OverNaive](https://avatars.githubusercontent.com/u/62283101?v=4)](https://github.com/OverNaive "OverNaive (6 commits)")

### Embed Badge

![Health badge](/badges/overnaive-think-swoole-crontab/health.svg)

```
[![Health](https://phpackages.com/badges/overnaive-think-swoole-crontab/health.svg)](https://phpackages.com/packages/overnaive-think-swoole-crontab)
```

###  Alternatives

[ashallendesign/short-url

A Laravel package for creating shortened URLs for your web apps.

1.4k1.9M4](/packages/ashallendesign-short-url)[intervention/zodiac

Zodiac Sign Calculator

58191.7k](/packages/intervention-zodiac)[erlandmuchasaj/laravel-gzip

Gzip your responses.

40129.3k2](/packages/erlandmuchasaj-laravel-gzip)[solspace/craft-calendar

The most powerful event management and calendaring plugin!

1830.8k1](/packages/solspace-craft-calendar)

PHPackages © 2026

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