Skip to content

Conversation

HypeMC
Copy link
Member

@HypeMC HypeMC commented Sep 25, 2025

Q A
Branch? 7.4
Bug fix? no
New feature? yes
Deprecations? no
Issues -
License MIT

This PR adds a MessageSentToTransportsEvent, that is dispatched only after a message was sent to at least one transport. This can be useful, for example, for additional monitoring.

Comment on lines -53 to -59
foreach ($senders as $alias => $sender) {
if (null !== $this->eventDispatcher && $shouldDispatchEvent) {
$event = new SendMessageToTransportsEvent($envelope, $senders);
$this->eventDispatcher->dispatch($event);
$envelope = $event->getEnvelope();
$shouldDispatchEvent = false;
}
Copy link
Member Author

@HypeMC HypeMC Sep 25, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a minor improvement:

  1. The event was originally dispatched outside the loop.
  2. It was later moved inside the loop because of the retry mechanism.
  3. The retry mechanism was later extracted, so there's no longer a need for the event to be dispatched inside the loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants