The server-sent events are certainly possible with webpy. You really
just set the mime-type of the response, and can then use the 'yield'
functionality to send out partial responses.  For instance:

class ServerSent:

    def GET(self):
        web.header("Content-Type", "application/x-dom-event-stream")
        while True:
                yield "Event: server-time\ndata: %s\n" % time.time()
                time.sleep(10)

That said, webpy creates a thread per connection and will keep that
thread alive as long as the client is connected.  You may want to look
into non-blocking frameworks if you'll need to handle enough
simultaneous connections -- tornado was created for this purpose.

-Justin

On Sep 30, 2:09 pm, Bruce Eckel <[email protected]> wrote:
> I don't know much about this technology, but it appears that support on the
> server side would be very helpful. Thanks for any insights.
>
> -- Bruce Eckelwww.Reinventing-Business.comwww.MindviewInc.com

-- 
You received this message because you are subscribed to the Google Groups 
"web.py" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/webpy?hl=en.

Reply via email to