[Twisted-Python] Twisted HTTP client supporting failover for multiple A records?

Luke Marsden luke-lists at hybrid-logic.co.uk
Thu Jul 15 09:54:22 EDT 2010


On Thu, 2010-07-15 at 14:28 +0100, Reza Lotun wrote:
> > I suspect you can do this without subclassing... pass in IP address, and
> > just make sure you pass correct Host header. I forget the exact API
> > though.

This makes sense. Conceptually I had considered it to be the
responsibility of the web client itself to handle the reconnection, not
the calling code, hence my plan for a subclass. But a separate class
which uses the Agent's API makes a lot more sense, and it can equally
provide the same interface as Agent so that any code which uses Agent
can use it without modifications.

> Yeah, I was about to say, why not just call socket.gethostbyname_ex in
> deferToThread and in the callback do a regular Agent.request?

Sounds like a plan! Thanks guys.

-- 
Best Regards,
Luke Marsden
Hybrid Logic Ltd.

Web: http://www.hybrid-cluster.com/
Hybrid Web Cluster - cloud web hosting based on FreeBSD and ZFS

Mobile: +447791750420




More information about the Twisted-Python mailing list