blomstra/database-queue
Composer 安装命令:
composer require blomstra/database-queue
包简介
Adds Database queues to Flarum
README 文档
README
This extension allows you to easily run a queue, using your database and by configuring one cron(job).
Disclaimer: this extension is provided "as is" by Blomstra. Only community support is provided.
Background and when you need this
By default, Flarum runs without a (background) queue. This means that all tasks of Flarum are processed during the request of the user.
A great example of this is email sending. When using flarum/subscriptions, fof/follow-tags, ianm/follow-users or any other extension that allows subscribing to things, email sent out to notify users. For smaller communities this is not a big deal, but at some point you'll notice your requests (posting for instance) may start to slow down. All of these emails are dispatched after the post is stored to the database.
To resolve this increasing burden, you can run a Queue. A queue runs on your server, it does not interact with the user and their requests. A user request, however, can dispatch tasks to the queue. This extension provides the easiest implementation of a queue and works on shared hosting environments as well.
Install
composer require blomstra/database-queue:"*"
Enable the extension inside the admin area. If you already have the Flarum scheduler setup, there's nothing more to do. Otherwise, see below:
Set up
Go into your hosting control panel and set up the following task to run every minute:
php flarum schedule:run
Or in cron language:
* * * * * cd /path/to/flarum && php flarum schedule:run
FAQ
What is the difference with blomstra/flarum-redis? The redis package (it's officially not an extension) is meant for larger communities. Redis offers the ability to scale the number of workers up however you need. Running a queue worker which pulls jobs from the database can also negatively impact your community performance when processing a lot of notifications and other queue tasks.
- Blomstra provides managed Flarum hosting.
- https://blomstra.net
blomstra/database-queue 适用场景与选型建议
blomstra/database-queue 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 7.39k 次下载、GitHub Stars 达 4, 最近一次更新时间为 2021 年 07 月 13 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「database」 「queue」 「flarum」 「blomstra」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 blomstra/database-queue 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 blomstra/database-queue 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 blomstra/database-queue 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Dibi is Database Abstraction Library for PHP
Store your language lines in the database, yaml or other sources
PHP AMQP Binding Library
A Laravel package to monitor queue jobs.
A package for automatically encrypting and decrypting Eloquent attributes in Laravel 5.5+, based on configuration settings.
Adds more BBCode
统计信息
- 总下载量: 7.39k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 4
- 点击次数: 8
- 依赖项目数: 1
- 推荐数: 1
其他信息
- 授权协议: MIT
- 更新时间: 2021-07-13