transports and connections

John Arbash Meinel john at arbash-meinel.com
Wed Aug 30 19:52:08 BST 2006


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.

John
=:->


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060830/5271312c/attachment.pgp 


More information about the bazaar mailing list