Add a method to clear all messages from a channel
まだ誰も着手していません。
評価
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 初心者へのやさしさ
- 45/100
- issue の種類
- 機能追加
- 明瞭さ
- おおむね明確
- 活発さ
- 静か
- 技術スタック
- php, rabbitmq, redis
調査の方向性
まず AdapterInterface と既存の push/status エントリポイントを読み、次に Redis、AMQP、インメモリのアダプターを調査します。purge と clear の命名、およびチャネルシグネチャに関する問題を解決してください。opt-in インターフェースと提案されたアダプター実装によって、プライマリインターフェースを変更せずにチャネルを空にできれば完了です。
索引モデルが issue の本文から書いたものです。
説明
Proposed new feature or change
There's no programmatic way to empty a queue. It comes up in three places:
- Maintenance - a
queue:purgecommand or an admin button to drop a queue that got flooded with poison pills or jobs that are no longer wanted. - Deployments - clearing a queue during a release when the payload structure changed and old queued jobs would crash on the new code.
- Testing - resetting state between runs. Shelling out to
redis-cliorrabbitmqctlmakes the test suite fragile and awkward to run in containerized CI.
I wouldn't put this on AdapterInterface - that would break every existing implementation and it overlaps with the "not the job of the primary interface" point from #271. A separate opt-in interface fits better:
interface PurgeableInterface
{
public function purge(): void;
}
Adapters implement it when the backend can do it cheaply (Redis drops the channel keys, AMQP calls queue_purge, the in-memory adapter resets its array). Callers check for it:
if ($adapter instanceof PurgeableInterface) {
$adapter->purge();
}
Open questions:
- Name:
purge()(broker vocabulary) orclear()? - Signature:
purge(): voidon the adapter's current channel (consistent withpush/status, which don't take a channel) orpurge(string $channel)?
Worth pursuing? Happy to send a PR if you're good with it (core + redis/amqp).
- 主要言語
- PHP
- スター
- 61
- フォーク
- 31
- 平均マージ
- 1日 7時間
- マージ済み PR(30日)
- 9
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
yiisoft/queue のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
-
難易度 4/5 3〜5日 初心者へのやさしさ 45/100
-
難易度 5/5 1週間以上 初心者へのやさしさ 35/100
-
status:ready for adoption type:test
似ている issue
-
status/awaiting_triage
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
WordPress/plugin-check#1486 ·
-
enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
az-digital/az_quickstart#6019 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
grokability/snipe-it#19688 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100