transports and connections

Robert Collins robertc at robertcollins.net
Wed Aug 30 23:31:06 BST 2006


On Wed, 2006-08-30 at 13:52 -0500, John Arbash Meinel wrote:
> Robert Collins wrote:
> > Martin Andrew and I were talking about how to test the smart server's
> > ssh hookup. We felt that it would be made easier if we define
> > 
> > get_transport() as /not/ connecting to the server, but rather the
> > returned transport connecting when the first operation is called on it.
> > 
> > This follows the idiom of having constructors not do complex or time
> > consuming things, and also fits protocols like http much better than
> > requiring that the result of get_transport mean the server is actually
> > available.
> > 
> > Thoughts ?
> > 
> > -Rob
> 
> One other thought, though. If we are going to do this, we may want
> explicit connect/disconnect. Not that it is required, but you start
> changing when we might raise ConnectionError, since it may happen during
> a .get() instead of during get_transport().
> 
> So it might be good to have a way to explicitly make sure that you are
> either connected, or fail, so that the exception handling can happen at
> that time, rather than throughout the code.

Not really : HTTP can fail at *any time*.

Making all transports look connectionless will model our lowest common
denominator well.

-Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060831/9bfdc613/attachment.pgp 


More information about the bazaar mailing list