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()eddequeue()ed entries. Alldequeue()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
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-15