[Twisted-Python] Twisted HTTP client supporting failover for multiple A records?
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.
Hybrid Logic Ltd.
Hybrid Web Cluster - cloud web hosting based on FreeBSD and ZFS
More information about the Twisted-Python