Closed kbond closed 3 years ago
I think its exactly the issue I am facing right now 🤔
I am doing sth like:
$this->bus->dispatch(
(new Envelope(SetNewConfirmationStatus::create($abo->getId(), $confirmationStatus)))
->with(new DispatchAfterCurrentBusStamp())
);
in my message handlers and I want to assertContains(SetNewConfirmationStatus::class, 1)
, but it is failing.
If you want you can have a look here: https://github.com/datana-gmbh/cockpit/pull/1320
Do you think this should be how process()
works generally?
$this->messenger()->process(); // continues processing recursively until no messages left on queue
$this->messenger()->process(5); // process recursively until 5 messages processed - fail if queue emptied before 5 processed
I'm thinking yes - can you think of any downsides?
Exactly, running process()
would be perfect to process recursively.
Right now not.
But right now a downside is "assertNotContains()", because it is not true if not alle messages are processed recursively, which would be fixed as well afterwards
When processing your queue, if some handler's add more messages to your queue, there should be an option to recursively process these as well.
I'm thinking:
-1
toTestTransport::process()
enables this.TestTransport::processRecursive()
shortcut.