I think it woudn't be too hard to add COMET support to application side
of cherrypy/ruberthart/turbogears. The WSGI spec basically states that
you should yield an empty string string when your not ready to produce
data. So the app code would  become something like:

@expose(allow_json=True)
def event_manager(self):
    while not (events or time_out():
        yield ''
    yield events or nothing_changed_msg

The problem with current WSGI server implementations is that they keep
iterating in the same request, even when the apps yields and empty
string.

What we really need is (async) WSGI server that would reschedule a
request handler when the WGI apps that yield an empty string. I belief
that the server woudn't need any complicated callbacks or triggers when
the select() timeout can be kept small enough. Select triggers are hard
to implement

I'm curently working on a single threaded WSGI server that uses sched
as scheduler and a asyncore.loop() based delay function. Content
producers (WSGI apps) are exponentialy delayed when they yield an empty
string. Now, since all of this happens in one single thread it could
mean that blocking app could tie up the entire server. Its my intention
to create some sort of threaded middleware to seperate blocking apps
from non-blocking apps if needed.


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" 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/turbogears
-~----------~----~----~----~------~----~------~--~---

Reply via email to