[Twisted-Python] Example of re-usable ClientFactories?

Glyph Lefkowitz glyph at twistedmatrix.com
Wed Jun 15 15:19:52 EDT 2011


On Jun 15, 2011, at 1:03 PM, Orestis Markou wrote:

> But, for most of the one-shot cases it seems that a ClientCreator (or an endpoint) would serve the same purpose, no?

I am not sure that I understand your message.  ClientFactory will be re-used if you re-use it; it won't be re-used if you don't.  There's no particularly compelling reason to do so or not to do so; just whatever happens to make sense within your application.

However, I should note that with the advent of endpoints, ClientFactory is no longer necessary.  Connection failure is communicated on an endpoint via the Deferred from connect() errbacking, so there's no need for the extra callbacks that ClientFactory provides.

-glyph

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://twistedmatrix.com/pipermail/twisted-python/attachments/20110615/7b0dda98/attachment.htm 


More information about the Twisted-Python mailing list