(self, message, channel)
Sends `message` to `channel`.
Sends `message` to `channel`.
Sends message to channel .
def send_message(self, message, channel):
        """
        Sends `message` to `channel`.
        """
        final_message = {
            # What we're delivering.
            'type': 'message',
            # Contents of the message.
            'payload': {
                'msg': message.replace('\n', '').replace('\r', '')
            },
            # Destination.
            'channel': {
                'channel': channel.channel,
                'host': channel.host,
                'port': channel.port,
                'ssl': channel.ssl
            }
        }
        message_dump = json.dumps(final_message)
        self.r.rpush(self.key_queue_messages, message_dump)
def send_message ( self , message , channel ) : final_message = { # What we're delivering. 'type' : 'message' , # Contents of the message. 'payload' : { 'msg' : message . replace ( '\n' , '' ) . replace ( '\r' , '' ) } , # Destination. 'channel' : { 'channel' : channel . channel , 'host' : channel . host , 'port' : channel . port , 'ssl' : channel . ssl } } message_dump = json . dumps ( final_message ) self . r . rpush ( self . key_queue_messages , message_dump )