code: async def publish(self, channel, event, data=None):
          
          msg = {'event': event, 'channel': channel}
          if data:
              msg['data'] = data
          try:
              await self.pubsub.publish(self.prefixed(channel), msg)
          except ConnectionRefusedError:
              self.connection_error = True
              self.logger.critical(
                  '%s cannot publish on "%s" channel - connection error',
                  self,
                  channel
              )
          else:
              self.connection_ok()
docs: Publish a new ``event`` on a ``channel``
  
          :param channel: channel name
          :param event: event name
          :param data: optional payload to include in the event
          :return: a coroutine and therefore it must be awaited