www/snapper/pyapp/app/flask_sse.py
def stream(self):
        """
        A view function that streams server-sent events. Ignores any
        :mailheader:`Last-Event-ID` headers in the HTTP request.
        Use a "channel" query parameter to stream events from a different
        channel than the default channel (which is "Event").
        to add destination:
            unsigned int types(SnapperEventType), char *desturl, char *ctx, char *prot, char *subtype, char *hdrs, char *msgids, char *res
        """
        channel = request.args.get('channel') or 'Event'
        sseclient = {}
        sseclient['remoteip'] = request.headers.get('X-Real-IP', 'unknown')
        sseclient['id'] =  _connector.connector_sse_add_dest(1, sseclient['remoteip'], str(time.time()), 'Redfish', 'SSE', '', '', '')
        request.sseconfig = sseclient

        @stream_with_context
        def generator():
            for message in self.messages(channel=channel):
                yield str(message)

        #return current_app.response_class(
        return SSEResponse(
            generator(),
            mimetype='text/event-stream',
            _id=sseclient['id'],
        )

        A view function that streams server-sent events. Ignores any
        :mailheader:`Last-Event-ID` headers in the HTTP request.
        Use a "channel" query parameter to stream events from a different
        channel than the default channel (which is "Event").
        to add destination:
            unsigned int types(SnapperEventType), char *desturl, char *ctx, char *prot, char *subtype, char *hdrs, char *msgids, char *res
        
A view function that streams server-sent events. Ignores any
A view function that streams server - sent events . Ignores any
def stream(self):
        channel = request.args.get('channel') or 'Event'
        sseclient = {}
        sseclient['remoteip'] = request.headers.get('X-Real-IP', 'unknown')
        sseclient['id'] =  _connector.connector_sse_add_dest(1, sseclient['remoteip'], str(time.time()), 'Redfish', 'SSE', '', '', '')
        request.sseconfig = sseclient
        @stream_with_context
        def generator():
            for message in self.messages(channel=channel):
                yield str(message)
        return SSEResponse(
            generator(),
            mimetype='text/event-stream',
            _id=sseclient['id'],
        )
def stream ( self ) : channel = request . args . get ( 'channel' ) or 'Event' sseclient = { } sseclient [ 'remoteip' ] = request . headers . get ( 'X-Real-IP' , 'unknown' ) sseclient [ 'id' ] = _connector . connector_sse_add_dest ( 1 , sseclient [ 'remoteip' ] , str ( time . time ( ) ) , 'Redfish' , 'SSE' , '' , '' , '' ) request . sseconfig = sseclient @ stream_with_context def generator ( ) : for message in self . messages ( channel = channel ) : yield str ( message ) return SSEResponse ( generator ( ) , mimetype = 'text/event-stream' , _id = sseclient [ 'id' ] , )
A view function that streams server-sent events.
A view function that streams server - sent events .
"""
        A view function that streams server-sent events. Ignores any
        :mailheader:`Last-Event-ID` headers in the HTTP request.
        Use a "channel" query parameter to stream events from a different
        channel than the default channel (which is "Event").
        to add destination:
            unsigned int types(SnapperEventType), char *desturl, char *ctx, char *prot, char *subtype, char *hdrs, char *msgids, char *res
        """ #return current_app.response_class(
self
mailheader
`Last-Event-ID` headers in the HTTP request.
Use a "channel" query parameter to stream events from a different
channel than the default channel (which is "Event").
` Last - Event - ID ` headers in the HTTP request . Use a " channel " query parameter to stream events from a different channel than the default channel ( which is " Event " ) .