> Nope, or maybe I expressed myself badly: that implementations started > named as "comet messaging" but turned to "websocket messaging" at the first > iteration. > web2py.js has an usable implementation for it and > gluon/contrib/websocket_messaging.py is 200 lines of which 70 are comments, > it's easy to hack it into. > >
As I said, I've already gone over the websocket_messaging.py file - it has dealings with WebSockets - NOT SSE (!) - and via Tornado, NOT web2py... > > I didn't get what you mean by "can I explicitely call it": either with > websockets or SSE as soon as the user hits the page, a connection is > established and remains open. There's no request/response cycle, just a > request coming in and a (eventually) infinite response out. > What I mean, is that once the connection is ope, and say, is handled by a "session", then from that moment on, My usage of this connection would be "pushing" through that connection onto the browser. The usage of the "push" would obviously be from another controller. I mean, let's take the "chat" use-case : User "A" logs into a chat-view, and that sends a GET request to a controller-action, who's job is to opens an SSE connection for that user - a long-lasting session - let's call it "The SSE action". Then user "B" logs into the same view on his side, and the same thing happens for him. Now we have 2 outgoing sessions open - one for each user - 2 "SSE Actions" are waiting to send more responses - each to their respective recipients. Now, user "A" writes a comment, and "submits" it. This sends a POST request to a different controller-action that saves the comment to the database -let's call it "The Submission Action". This controller-action is different from the SSE action, and may theoretically even belong to a different controller (say, the system may have chat-views in multiple pages...). My question is, then : "Can a submission-action 'call' an SSE-action that belongs to a different controller, and has a different session/request/response object(s)? If so How?". I hope it's more clear now... -- --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/groups/opt_out.