Thanks to visit codestin.com
Credit goes to github.com

Skip to content

[Scheduler] Make MessageGenerator yield some scheduling context #50130

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

Merged
merged 1 commit into from
Apr 24, 2023

Conversation

tucksaun
Copy link
Contributor

@tucksaun tucksaun commented Apr 23, 2023

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.

@tucksaun tucksaun requested a review from kbond as a code owner April 23, 2023 20:08
@carsonbot carsonbot added this to the 6.3 milestone Apr 23, 2023
@tucksaun tucksaun changed the title [Scheduler] Allow MessageGenerator to yield some context [Scheduler] Make MessageGenerator yield some scheduling context Apr 23, 2023
@tucksaun tucksaun force-pushed the scheduler/generator-context branch from 7a21297 to 7452f8a Compare April 23, 2023 20:10
And add it to the ScheduledStamp in case of use within Messenger.

Replaces 50096
Fix 50085

This approach allows to provie some context that the message consumers can use or not depending on its use case
@tucksaun tucksaun force-pushed the scheduler/generator-context branch from 7452f8a to 3664d08 Compare April 23, 2023 20:11
Copy link
Member

@kbond kbond left a comment

Choose a reason for hiding this comment

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

I like this much better than #50096!

@fabpot
Copy link
Member

fabpot commented Apr 24, 2023

Thank you @tucksaun.

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.

[Scheduler] Expose the run date?
4 participants