定制 flarum-com/database-queue 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

flarum-com/database-queue

最新稳定版本:2.0.0-beta.1

Composer 安装命令:

composer require flarum-com/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". 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 flarum-com/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.

统计信息

  • 总下载量: 33
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 0
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-01-23