dominionenterprises/mongo-queue-php

此包已被弃用,不再维护。作者建议使用 traderinteractive/mongo-queue 包。

使用 MongoDB 作为后端的消息队列

v4.1.0 2023-08-04 19:43 UTC

This package is auto-updated.

Last update: 2023-08-04 19:46:00 UTC


README

Scrutinizer Code Quality

Latest Stable Version Latest Unstable Version License

Total Downloads Daily Downloads Monthly Downloads

使用 MongoDB 作为后端的 PHP 消息队列。

特性

  • 通过 MongoDB 查询进行消息选择和/或计数
  • 通过 MongoDB 在机器间分发
  • 消息优先级
  • 延迟消息
  • 运行中的消息超时和重发
  • 原子确认和发送
  • 仅基于有效负载的简单索引创建

最简单用法

use TraderInteractive\Mongo\Queue;

$queue = new Queue('mongodb://localhost', 'queues', 'queue');
$queue->send(new Message());
$messages = $queue->get([], ['runningResetDuration' => 60]);
foreach ($messages as $message) {
    // Do something with message

    $queue->ack($message);
}

Composer

要作为本地、项目特定的依赖项添加库,请使用 Composer!只需将 traderinteractive/mongo-queue 依赖项添加到项目中的 composer.json 文件中,如下所示

composer require traderinteractive/mongo-queue

文档

在源代码本身中找到,请查看!

联系

开发者可以通过以下方式联系

贡献

如果您想做出贡献,请使用我们的构建流程对任何更改进行操作,构建通过后,请通过 github 向我们发送拉取请求!

./vendor/bin/phpunit
./vendor/bin/phpcs

还有一个基于 dockerfig 配置,该配置将在 docker 容器内执行构建。这是构建应用程序的简单方法

fig run build