Download the PHP package karlhsu/think-closure-dispatch without Composer
On this page you can find all versions of the php package karlhsu/think-closure-dispatch. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download karlhsu/think-closure-dispatch
More information about karlhsu/think-closure-dispatch
Files in karlhsu/think-closure-dispatch
Download karlhsu/think-closure-dispatch
More information about karlhsu/think-closure-dispatch
Files in karlhsu/think-closure-dispatch
Vendor karlhsu
Package think-closure-dispatch
Short Description Laravel-style dispatch with closure support for ThinkPHP
License MIT
Package think-closure-dispatch
Short Description Laravel-style dispatch with closure support for ThinkPHP
License MIT
Please rate this library. Is it a good library?
Informations about the package think-closure-dispatch
ThinkPHP Closure Dispatch
为 ThinkPHP 提供类似 Laravel 的闭包队列调度功能。
安装
要求
- PHP >= 7.4
- ThinkPHP >= 6.0
- ThinkPHP Queue >= 3.0
使用方法
基本使用
配置
确保项目中已安装并配置了 topthink/think-queue
包。在 config/queue.php
中配置队列连接信息:
最佳实践
- 对于复杂的任务,建议创建独立的 Job 类
- 使用队列时注意设置合理的重试次数和超时时间
- 建议在闭包中捕获异常并记录日志
- 对于需要传递大量数据的任务,建议使用数据库或缓存存储数据,在闭包中只传递数据ID
示例:
注意事项
- 闭包中使用的变量需要是可序列化的
- 如果闭包中使用了类,确保这些类可以被正确序列化
- 建议在闭包中只处理业务逻辑,避免使用外部依赖
测试
License
MIT
All versions of think-closure-dispatch with dependencies
PHP Build Version
Package Version
Requires
php Version
>=7.4
topthink/framework Version ^6.0
opis/closure Version ^3.6
nesbot/carbon Version ^2.0
topthink/think-queue Version ^3.0
topthink/framework Version ^6.0
opis/closure Version ^3.6
nesbot/carbon Version ^2.0
topthink/think-queue Version ^3.0
The package karlhsu/think-closure-dispatch contains the following files
Loading the files please wait ....