Skip to content

Instantly share code, notes, and snippets.

@codephillip
Created January 28, 2022 11:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save codephillip/71ed38e3f721579a87c5405aaf37c52e to your computer and use it in GitHub Desktop.
Save codephillip/71ed38e3f721579a87c5405aaf37c52e to your computer and use it in GitHub Desktop.
from ms_foobar_app.events.event_bus_root import EventBus
class EventPublisher(EventBus):
def __init__(self):
super(EventPublisher, self).__init__()
def publish(self, subject, data):
self.loop.run_until_complete(self.__publish(subject, data))
async def __publish(self, subject, data):
await self.sc.publish(subject, self.byte_encode_data(data))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment