Hi,
I've been trying to keep a http connection open for the server to keep sending data over. (what some call Comet I believe...)
This is my code...
-----------
from turbogears import controllers, expose
import time
class Root(controllers.Root):
@expose()
def index(self):
i = 0
while 1:
yield str(i)
time.sleep(0.5)
i += 1
------------
It started working after I added these settings to dev.cfg...
------------
streamResponse = True
server.environment="production" #required for streaming (
http://www.archivesat.com/Cherrypy_users/thread113782.htm)
-------------
It basically works but for some reason (I'm new to Turbogears :-) ) it only serves a single client.
I've tried "server.threadPool
= 10" in dev.cfg but this was not the fix I was hoping for.
I plan to use this for a webgame client that we (some guys from the PyPy community) wrote in RPython to test the translation to _javascript_.
Currently we do about 5-20 requests per second but with this we get server data quicker and we can still send new data(/requests) to the server
over another http connection.
cheers
Eric
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---
- [TurboGears] longlived connectionsin TG/Cherrypy Eric van Riet Paap
- [TurboGears] Re: longlived connectionsin TG/Cher... Eric van Riet Paap
- [TurboGears] Re: longlived connectionsin TG/... Richard Clark
- [TurboGears] Re: longlived connectionsin... Sylvain Hellegouarch

