Skip to Content
Menu
This question has been flagged
1 Reply
2799 Views

Hello! 


i am trying to do a SSE aplication, where everytime a new register in an odoo module pushes its info to a frontend located outisde odoo.


The idea is something like this


var eventSource = new EventSource("http://localhost:8069/stream");
eventSource.addEventListener = (function(e) {
    console.log(e.data)
});


@http.route("/stream", auth='public', cors='*', csrf=False, type='http', website='true') 

def stream(self): 


    return Response(eventStream(), mimetype="text/event-stream")


def eventStream(): 

    yield "data: test\n\n"


bu ti think im going for the wrong path to solve this, since this is just calling the server forever

Avatar
Discard
Best Answer

Hi Erick! Did you ever figure out the answer to your question?
I'm looking into adding SSE for AI streaming.

Avatar
Discard
Related Posts Replies Views Activity
2
Jan 19
3816
0
Sep 21
2383
1
May 25
406
0
Oct 24
593
0
Jun 24
798