Hey there,
I'm currently writing a webgame and wonder how to handle longcalls
without eating up the application server's threads.
Currently I do something similar to the following in the longcall
code:
====== snip ========
import threading
import web
cond = threading.Condition() # for simplicity! actually each client
has an own condition, so only the client for whom a message arrived is
notified.
urls = ( "/longcall", "longcall",)
app = web.application(urls, globals())
class longcall:
def GET(self):
with cond:
cond.wait() # thread sleeps till notified
return someNewData
==================
The problem I see in this is that with a growing number of clients a
growing amount of the application server's worker threads are
sleeping.
Is there a better way?
Jörn
--
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.