[Twisted-Python] connection pool
exarkun at divmod.com
Thu Jan 17 06:17:52 EST 2008
On Thu, 17 Jan 2008 10:42:34 +0100, tjerk.kusters at imtech.nl wrote:
>>making a blocking call (CORBA) inside the reactor loop, which prevents
>>other connections to happen. If you don't manage to find an
>>asynchronous CORBA client, you should do the call inside a thread,
>>using reactor.callInThread for example.
>>However, it would be easier to help you with an example of your code
>>or a more detailed description of your problem.
>I have create a small example program to show my problem.
> def render_GET(self, request):
> request.write("module 2<br>")
> return ""
At some point (perhaps the next version of Twisted, perhaps not), render_GET
will support Deferreds so this will get easier. However, until then, you
can still have asynchronous render_GET implementations. You just have to
from twisted.web.resource import NOT_DONE_YET, Resource
from twisted.internet.defer import Deferred
from twisted.internet import reactor
def render_GET(self, request):
d = Deferred()
reactor.callLater(3, d.callback, "the result")
Hope this helps,
More information about the Twisted-Python