When a closed channel is accessed, the protocol classes are no longer bound, e.g. channel.basic. The reason for this is that they're cleaned up so that circular references can be quickly removed rather than waiting for the garbage collector.
One of the problems however is that the user has to either check for the closed state, or handle an ambiguous AttributeError, before calling channel.basic, etc. A better approach would be to replace the bindings with properties that raise the ChannelClosed exception on access.
When a closed channel is accessed, the protocol classes are no longer bound, e.g.
channel.basic
. The reason for this is that they're cleaned up so that circular references can be quickly removed rather than waiting for the garbage collector.One of the problems however is that the user has to either check for the closed state, or handle an ambiguous
AttributeError
, before callingchannel.basic
, etc. A better approach would be to replace the bindings with properties that raise theChannelClosed
exception on access.