`InMemoryAdapter` loses the assigned ID between push and consume
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Idoneità per principianti
- 54/100
Direzione di ricerca
Read stubs/InMemoryAdapter.php, especially the push() implementation around lines 44–46, and trace how Worker::process() consumes messages. Check the logging middleware described in performance-tuning.md and the related behavior in issue #341. Confirm the adapter retains the assigned ID through consumption, and that the handler’s envelope behavior matches the intended interaction.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
InMemoryAdapter::push() stores the original message and returns the IdEnvelope only to the caller:
$id = count($this->messages) + $this->current;
$this->messages[] = $message; // stubs/InMemoryAdapter.php:44
return new IdEnvelope($message, $id); // stubs/InMemoryAdapter.php:46
So the id exists for whoever called push(), and nowhere else:
push() returned: IdEnvelope id=0
stored in adapter: GenericMessage meta=[]
INFO: Pushed message with message type "probe" to the queue. Assigned ID #0.
INFO: Processing message without ID.
Anything reading the id at consume time gets null for every message that went through this adapter — Worker::process() itself, and the logging middleware the guide suggests in performance-tuning.md. Meanwhile status($id) does answer for that id, so the two halves of the adapter disagree about whether the message has one.
Storing the envelope instead ($this->messages[] = new IdEnvelope($message, $id)) would make them agree, and would make the stub behave like an adapter that persists what it returns.
Note this interacts with #341: once the envelope is what gets stored, the handler starts receiving an IdEnvelope on the in-memory path too, which is the behaviour that issue is about.
- Lingua principale
- PHP
- Stelle
- 60
- Fork
- 32
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi 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
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Difficoltà 4/5 1-2 giorni Idoneità per principianti 47/100
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
-
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
Tutte le issue di yiisoft/queue
Issue simili
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 92/100
I maintainer di solito rispondono entro 1 giorno
-
Authentication / Authorization Feature: Volunteer
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 64/100
WordPress/mcp-adapter#399 ·
I maintainer di solito rispondono entro 1 giorno
-
create:theme --tailwind scaffolds version.yaml at 1.0.0 while the LESS variant scaffolds 1.0.1Aperta
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 80/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 85/100
freescout-help-desk/freescout#5750 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno