[Twisted-Python] Basic factory question

Ted Pederson ted.pederson at gmail.com
Mon Apr 13 14:25:12 EDT 2009


Coming from C++ to python/twisted. Looking at samples, created a simple
server and want to create a tester file that will create many clients to
connect to and exercise my server. All very nice and easy and like this a
lot so far.

The one thing that looks strange to me is that the samples instantiate a
ClientFactory to then connect to the server via reactor.connectTCP().

I copied this pattern, worried that a factory would be created for every one
of my clients, and this is indeed what happened. Isn't the point of a
factory to generate all of the clients? I'd like to keep some aggregate info
in 1 factory, and have the factory contain the dbpools, etc.. How to do
this?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20090413/025a3693/attachment.htm 


More information about the Twisted-Python mailing list