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

Glyph Lefkowitz glyph at twistedmatrix.com
Wed Jun 15 16:24:01 EDT 2011


On Jun 15, 2011, at 4:08 PM, exarkun at twistedmatrix.com wrote:

>> 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.
> 
> Except clientConnectionLost.


I chose my words carefully :-).

clientConnectionLost was always a duplicate of IProtocol.connectionLost.

It might be handy to have that notification delivered in multiple places (specifically, for implementing ReconnectingClientFactory), but it's not necessary (there's no "need" for it) since you can clone it by wrapping IProtocol instead of duplicating it in the guts of the reactor.

-glyph

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


More information about the Twisted-Python mailing list