Transport.close()

Robert Collins robertc at robertcollins.net
Mon Sep 25 11:55:42 BST 2006


On Fri, 2006-09-22 at 09:04 -0400, Aaron Bentley wrote:


> > I agree that there's no easy answer (e.g. because multiple transport objects can
> > share connections) but the status quo is inadequate.
> 
> Well, it seems like dropping another transport's connection is
> anti-social.  Maybe it should raise an exception if the connection is
> shared?  Because I think if Transport.close() is useful, it's useful
> because it acts right away.  So making it just decrement a reference
> count seems not useful, and may indicate programmer error.

Its more complex than that IMO.

Consider sftp:

file_handle = a_transport.get_file('foo')
a_transport.close()
file_handle.read()

In other words, because transport returns objects that depend on the
transport, closing a transport may be inherently flakey.

I'd like us to put some use cases for disconnecting together, and then
we can plan how it should work.

-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/20060925/1a62deb5/attachment.pgp 


More information about the bazaar mailing list