www/snapper/pyapp/app/flask_sse.py
def publish(self, data, type=None, id=None, retry=None, channel='Event'):
        """
        Publish data as a server-sent event.

        :param data: The event data. If it is not a string, it will be
            serialized to JSON using the Flask application's
            :class:`~flask.json.JSONEncoder`.
        :param type: An optional event type.
        :param id: An optional event ID.
        :param retry: An optional integer, to specify the reconnect time for
            disconnected clients of this stream.
        :param channel: If you want to direct different events to different
            clients, you may specify a channel for this event to go to.
            Only clients listening to the same channel will receive this event.
            Defaults to "Event".
        """
        message = Message(data, type=type, id=id, retry=retry)
        msg_json = json.dumps(message.to_dict())
        return self.redis.publish(channel=channel, message=msg_json)

        Publish data as a server-sent event.

        :param data: The event data. If it is not a string, it will be
            serialized to JSON using the Flask application's
            :class:`~flask.json.JSONEncoder`.
        :param type: An optional event type.
        :param id: An optional event ID.
        :param retry: An optional integer, to specify the reconnect time for
            disconnected clients of this stream.
        :param channel: If you want to direct different events to different
            clients, you may specify a channel for this event to go to.
            Only clients listening to the same channel will receive this event.
            Defaults to "Event".
        
Publish data as a server-sent event.
Publish data as a server - sent event .
def publish(self, data, type=None, id=None, retry=None, channel='Event'):
        message = Message(data, type=type, id=id, retry=retry)
        msg_json = json.dumps(message.to_dict())
        return self.redis.publish(channel=channel, message=msg_json)
def publish ( self , data , type = None , id = None , retry = None , channel = 'Event' ) : message = Message ( data , type = type , id = id , retry = retry ) msg_json = json . dumps ( message . to_dict ( ) ) return self . redis . publish ( channel = channel , message = msg_json )
Publish data as a server-sent event.
Publish data as a server - sent event .
"""
        Publish data as a server-sent event.

        :param data: The event data. If it is not a string, it will be
            serialized to JSON using the Flask application's
            :class:`~flask.json.JSONEncoder`.
        :param type: An optional event type.
        :param id: An optional event ID.
        :param retry: An optional integer, to specify the reconnect time for
            disconnected clients of this stream.
        :param channel: If you want to direct different events to different
            clients, you may specify a channel for this event to go to.
            Only clients listening to the same channel will receive this event.
            Defaults to "Event".
        """
self
data
The event data. If it is not a string, it will be
serialized to JSON using the Flask application's
:class:`~flask.json.JSONEncoder`.
The event data . If it is not a string it will be serialized to JSON using the Flask application ' s : class : ` ~flask . json . JSONEncoder ` .
type
An optional event type.
An optional event type .
id
An optional event ID.
An optional event ID .
retry
An optional integer, to specify the reconnect time for
disconnected clients of this stream.
An optional integer to specify the reconnect time for disconnected clients of this stream .
channel
If you want to direct different events to different
clients, you may specify a channel for this event to go to.
Only clients listening to the same channel will receive this event.
Defaults to "Event".
If you want to direct different events to different clients you may specify a channel for this event to go to . Only clients listening to the same channel will receive this event . Defaults to " Event " .