[Twisted-Python] connection pool

Tjerk.Kusters at imtech.nl Tjerk.Kusters at imtech.nl
Wed Jan 16 08:48:43 EST 2008


Hello,

I have build a webserver with Twisted 2.4 with imports of the following:

 from twisted.web import resource, static, server, twcgi
 from twisted.internet import reactor

I'm adding several mods as child to the root with:

 root = static.File(settings.getSetting("html_directory"))
 root.putChild(mods.getPath(), mods

The mods are classes like

 class module(resource.Resource):
   def render_GET(self, request):
      # do something

The reactor is started as:
 reactor.listenTCP(_port, server.Site(root))
 reactor.run( )

Some of the GET request in the mods can take some time to complete. In the
current situation other request to the server have to wait on this request.

Is it possible to make soms kind of a thread/connection pool so that more
then one request can be handled at the same time?

Regards,
Tjerk





More information about the Twisted-Python mailing list