amtgard/amtgard-interfaces 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

amtgard/amtgard-interfaces

最新稳定版本:v1.0.2

Composer 安装命令:

composer require amtgard/amtgard-interfaces

包简介

Generic interfaces for use by Amtgard dependencies

README 文档

README

Generic interfaces package

Interfaces Defined

  • EntryInterface - a key value pair
  • HashSetInterface - a set interface using EntryInterface elements
  • QueueInterface - a queue interface using EntryInterface elements
  • RedrivableQueueInterface - a redrivable queue interface (see below)
  • SetQueue - a Queue that dedupes entries based on a Set
  • PubSubQueueInterface - a pub/sub topic provider based on a redrivable SetQueue

Definitions

RedrivableQueueInterface

A redrivable queue operates just like a normal queue (enqueue(), dequeue()) but adds two new interface methods:

  • redrive() - replays all un-commit()ed dequeue()ed entries. All dequeue()ed entries are automatically appended to the redrive queue.
  • commit() - marks an entry as non-redrivable (removes from the redrive queue)

So in operation, your workflow would be something like this:

$entry = $redrivableQ->dequeue();
$requiresRedrive = false;
try {
  $processStatus = processEntry($entry);
  if (SUCCESS == $processStatus) {
    $redrivableQ->commit($entry);
  }
} catch (\ProcessingException $e) {
    $requiresRedrive = true;
}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2025-07-15