Open
Description
Symfony version(s) affected
6.4.0
Description
When the handler is a generator (which you might want if using it sync, and shouldn't be an issue when using async, the values just get ignored), Messenger doesn't recognize failures to execute the handler.
How to reproduce
Do this
#[AsHandler]
class MessageHandler {
function __invoke(Message $message): iterable
{
dd($message);
yield $message;
}
}
From my experimentations, this works as expected when using sync transport, but fails with async (in my case Redis), it doesn't recognize the handler having failed.
Possible Solution
Check for the handler being a generator?
Additional Context
No response