-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[Scheduler] add schedule name to ScheduledStamp
#49864
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
) { | ||
} | ||
|
||
public function get(): iterable | ||
{ | ||
foreach ($this->messageGenerator->getMessages() as $message) { | ||
yield Envelope::wrap($message, [new ScheduledStamp()]); | ||
yield Envelope::wrap($message, [new ScheduledStamp($this->name)]); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
but that doesn't work: the name is something that belongs to a schedule, not to the transport. The generated messages can come from many schedules.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Each schedule has its own transport though.
…ing context (tucksaun) This PR was merged into the 6.3 branch. Discussion ---------- [Scheduler] Make `MessageGenerator` yield some scheduling context | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | Fix #50085, "replaces" #50096?, could help with #49864 | License | MIT | Doc PR | no doc yet for Scheduler This PR introduces a new `MessageContext` that `MessageGenerator` should use as key when yielding messages to provide more context about the scheduled message. The consumer of the scheduled messages can decide to use it or not. The PR also adds the wiring to add this context to the `ScheduledStamp` when using Scheduler within Messenger. This allows to add more context but without introducing a hard dependency on Messenger. /cc `@kbond` Note: this PR is not adding the scheduler name (cf #49864) because I don't know exactly where to wire it yet but I don't see anything preventing it to be added to the context once we know where it should belong. Commits ------- 3664d08 [Scheduler] Allow MessageGenerator to provide a MessageContext
Closing in favour of #50155. |
This PR was merged into the 6.3 branch. Discussion ---------- [Scheduler] add schedule name to `MessageContext` | Q | A | ------------- | --- | Branch? | 6.3 | Bug fix? | no | New feature? | yes | Deprecations? | no | Tickets | n/a | License | MIT | Doc PR | n/a Alternative to #49864. Commits ------- dc0f0e2 [Scheduler] add schedule name to `MessageContext`
As discussed in #49838, it would be nice to have the schedule name available on the stamp.