You said that the commet-thing is no longer existing, as "websockets" where > already included in web2py.js, which as I remember correctly is referenced > in the main application layout. But what about SSE? I mean, sure, it's just > an HTTP request, at start, but there is a different model for > "responding"... >
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. > How is web2py built for doing that? Is it keeping the session afloat for > that connection, if it get's the correct MIME-type? Will I just be able to > reuse the same controller-action for consecutive replies? > given that there's no "web2py+sse" package around, but only that app, you should wait/ask for who did that app ^_^ Of course the sse the implementation can be easily done within web2py, but given that the issue is that the connection stays open, you should run web2py in an evented environment. >From what I can see without having tested anything, you just return the text/event-stream content-type and in a loop you yield the message "segment". Can I explicitly call it from another controller, from a different session? > Where should a "yield" be placed? There is ZERO documentation about this in > the web2py book, and there was only one thread about this in this group, > which had an attached "example application" packed in a w2p file that I > couldn't use for some reason... > Of course you need to disable session locking when accessing to that controller with session.forget(response): basically that controller is "held captive" as soon as the user's connects to it. 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. Where you yield is at your discretion, but at least you should yield at the end of a single message. -- --- 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 [email protected]. For more options, visit https://groups.google.com/groups/opt_out.

