-
Notifications
You must be signed in to change notification settings - Fork 23
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
feat: make signal parameter optional in preparation for removal #219
Conversation
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.
Thoughts around comments, but non-blocking.
def make_single_consumer(*, topic: str, group_id: str, signal: OpenEdxPublicSignal, **kwargs) -> EventBusConsumer: | ||
def make_single_consumer(*, topic: str, group_id: str, | ||
signal: OpenEdxPublicSignal = None, # pylint: disable=unused-argument | ||
**kwargs) -> EventBusConsumer: | ||
""" | ||
Construct a consumer for a given topic, group, and signal. |
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.
- Do you want to drop
signal
from here now? - Should we add a sentence stating that the signals will be determined by the message header, or do we not even need to mention signals in the future?
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.
- Going to keep signal here for now since this is part of the public API. I don't know of anyone who uses it but I've broken things before by unexpectedly changing a public API method
- I think we should just not mention it
openedx_events/event_bus/__init__.py
Outdated
@@ -166,12 +168,11 @@ def make_single_consumer(*, topic: str, group_id: str, signal: OpenEdxPublicSign | |||
Arguments: | |||
topic: The event bus topic to consume from (without any environmental prefix) | |||
group_id: The consumer group to participate in | |||
signal: Send consumed, decoded events to the receivers of this signal | |||
signal: DEPRECATED signals determined by message headers |
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.
If you add the notion of signals determined by message headers
to a more permanent comment, then maybe the following would be more clear?
signal: DEPRECATED signals determined by message headers | |
signal: (DEPRECATED) this argument will be ignored. |
required=True, | ||
help='Type of signal to emit from consumed messages.' | ||
required=False, | ||
help='DEPRECATED signal will be determined by message headers' |
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.
See related comment and do what you think is best.
Description:
Makes the
signal
parameter of the consume_events command optional in preparation for complete removal. The signal will now be determined from the message headers.ISSUE:
#218
Dependencies:
If we're being nice, should probably not be merged before openedx/event-bus-redis#22, although the event bus redis is not production-ready yet anyway.
Reviewers:
Merge checklist:
Post merge:
finished.
Author concerns: List any concerns about this PR - inelegant
solutions, hacks, quick-and-dirty implementations, concerns about
migrations, etc.