docs: async def emit_event(self, event):
          """
          Publish an event
          :param event: Event object
          """
          self.log.info("publishing event on %s", self.publish_topic)
          if self.config.extra['config']['pub_options']['retain']:
              try:
                  await persist_event(
                      self.publish_topic,
                      event,
                      self.pool
                  )
              except SystemError as error:
                  self.log.error(error)
                  return
  
          loop = asyncio.get_event_loop()
          producer = AIOKafkaProducer(
              loop=loop,
              bootstrap_servers=self.transport_host
          )
          await producer.start()
  
          try:
              event = json.dumps(event.__dict__).encode()
              await producer.send_and_wait(
                  self.publish_topic,
                  event
              )
          finally:
              await producer.stop()