Skip to content

Commit

Permalink
feat!: remove signal argument from consumer (#221)
Browse files Browse the repository at this point in the history
 Removes the deprecated and unused 'signal' argument from consume_events and the underlying consumer abstract class.
  • Loading branch information
Rebecca Graber authored May 17, 2023
1 parent 955c1f2 commit 7b0d9a4
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@ Change Log
Unreleased
----------

[8.0.0] - 2023-05-16
--------------------
Changed
~~~~~~~
* **Breaking change**: Remove ``signal`` argument from consume_events and make_single_consumer

[7.3.0] - 2023-05-15
--------------------
Changed
Expand Down
2 changes: 1 addition & 1 deletion openedx_events/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
more information about the project.
"""

__version__ = "7.3.0"
__version__ = "8.0.0"
2 changes: 0 additions & 2 deletions openedx_events/event_bus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,6 @@ def consume_indefinitely(self) -> None:


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.
Expand All @@ -168,7 +167,6 @@ def make_single_consumer(*, topic: str, group_id: str,
Arguments:
topic: The event bus topic to consume from (without any environmental prefix)
group_id: The consumer group to participate in
signal: DEPRECATED This argument will be ignored. Signals will be determined by message headers
"""
options = {
'topic': topic,
Expand Down
10 changes: 2 additions & 8 deletions openedx_events/management/commands/consume_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class Command(BaseCommand):
"""

help = """
Consume messages of specified signal type from a topic and send their data to that signal.
Consume messages from a topic and emit their data with the correct signal.
Example::
Expand All @@ -34,7 +34,7 @@ class Command(BaseCommand):

def add_arguments(self, parser):
"""
Add arguments for parsing topic, group, signal and extra args.
Add arguments for parsing topic, group, and extra args.
"""
parser.add_argument(
'-t', '--topic',
Expand All @@ -48,12 +48,6 @@ def add_arguments(self, parser):
required=True,
help='Consumer group id'
)
parser.add_argument(
'-s', '--signal',
nargs=1,
required=False,
help='DEPRECATED This argument will be ignored. Signals will be determined by message headers'
)
parser.add_argument(
'--extra',
nargs='?',
Expand Down

0 comments on commit 7b0d9a4

Please sign in to comment.