Common: Change parameter name event_data -> event in Island event queue

This commit is contained in:
Shreya Malviya 2022-09-06 17:47:01 +05:30
parent 265e083571
commit 71c7a9a533
2 changed files with 4 additions and 4 deletions

View File

@ -28,12 +28,12 @@ class IIslandEventQueue(ABC):
pass
@abstractmethod
def publish(self, topic: IslandEventTopic, event_data: Any = None):
def publish(self, topic: IslandEventTopic, event: Any = None):
"""
Publishes an event topic with the given data
:param topic: Event topic to publish
:param event_data: Event data to pass to subscribers with the event publish
:param event: Event to pass to subscribers with the event publish
"""
pass

View File

@ -52,7 +52,7 @@ class PyPubSubIslandEventQueue(IIslandEventQueue):
# scope. Adding subscribers to self._refs prevents them from ever going out of scope.
self._refs.append(subscriber)
def publish(self, topic: IslandEventTopic, event_data: Any = None):
def publish(self, topic: IslandEventTopic, event: Any = None):
topic_value = topic.value # needs to be a string for pypubsub
logger.debug(f"Publishing {topic_value} event")
@ -61,4 +61,4 @@ class PyPubSubIslandEventQueue(IIslandEventQueue):
# otherwise, errors will arise. The MDS of a topic is set when the topic is created,
# which in our case is when a subscriber subscribes to a topic (in `subscribe()`)
# which is new (hasn't been subscribed to before).
self._pypubsub_publisher.sendMessage(topicName=topic_value, event=event_data)
self._pypubsub_publisher.sendMessage(topicName=topic_value, event=event)