[Twisted-Python] Example of re-usable ClientFactories?
exarkun at twistedmatrix.com
exarkun at twistedmatrix.com
Wed Jun 15 14:08:07 MDT 2011
On 07:19 pm, glyph at twistedmatrix.com wrote:
>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.
Except clientConnectionLost.
Jean-Paul
More information about the Twisted-Python
mailing list