Add a method to clear all messages from a channel
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Tranquilla
- Stack tecnologico
- php, rabbitmq, redis
- Ambito
- backend, distributed-systems
Direzione di ricerca
Inizia leggendo AdapterInterface e gli entry point esistenti di push/status, quindi esamina gli adapter Redis, AMQP e in-memory. Risolvi le questioni relative ai nomi purge rispetto a clear e alla firma del canale; il lavoro è completato quando l’interfaccia opt-in e le implementazioni degli adapter proposte supportano lo svuotamento di un canale senza modificare l’interfaccia primaria.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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).
- Lingua principale
- PHP
- Stelle
- 61
- Fork
- 31
- Merge medio
- 1g 7h
- PR unite (30g)
- 9
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di yiisoft/queue
-
Adapter delay support flag Aperta
Difficoltà 4/5 3-5 giorni Idoneità per principianti 56/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Improve test coverage Apertastatus:ready for adoption type:test
Tutte le issue di yiisoft/queue
Issue simili
-
status/awaiting_triage
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 90/100
WordPress/plugin-check#1486 ·
-
enhancement
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
az-digital/az_quickstart#6019 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
grokability/snipe-it#19688 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100