[Twisted-Python] Dealing with an intermittent PB server

Phil Mayers p.mayers at imperial.ac.uk
Thu Feb 17 18:17:45 EST 2005

On Thu, Feb 17, 2005 at 02:51:28PM -0800, Dave Cook wrote:
>On Thu, 17 Feb 2005 01:05:22 +0000, Phil Mayers <p.mayers at imperial.ac.uk> wrote:
>>   def connect(self):
>>     f = pb.PBClientFactory()
>>     reactor.connectTCP(host, port, f)
>>     f.getRootObject().addCallbacks(self.connect_ok, self.connect_fail)
>Maybe I should do it the way you do here and not create the client
>factory until I need it rather than at the start of my application. 
>How costly is it to create the client factories each time?

I don't honestly know - not significantly I think, looking at the code 
(but then "not significantly" depends on if you're talking once a second 
or a hundred time a second, really :o)

More information about the Twisted-Python mailing list