-
Notifications
You must be signed in to change notification settings - Fork 29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactored close procedures to dispatch Errors for all components #55
Refactored close procedures to dispatch Errors for all components #55
Conversation
79016a6
to
ad2abf9
Compare
Rebased |
Bump. I would really appreciate feedback on this, as it's a stopper for #34 |
Apologies, I haven't had time to review this. I'll try and do it ASAP |
e24715e
to
7452b63
Compare
self.close() | ||
|
||
def close(self): | ||
assert not self._closed, "Why do we close it 2-ce?" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this possible? If a user could provoke this condition by (ab)using the API, we should explicitly throw an exception. (If you believe it to be impossible, then an assertion is fine.)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's not possible. We didn't specify protocol as part of public API in docs.
53afe70
to
23ba3a8
Compare
… good grained exceptions. Changed Exceptions hierarchy to: AMQPError AMQPConnectionError ConnectionLostError ClientConnectionClosed ServerConnectionClosed AMQPChannelError ClientChannelClosed ContentTooLarge NotFound NoConsumers NotAllowed ...
b8e5df3
to
f2d9c9f
Compare
Squashed and cleaned code. Removed some unneeded changes, so they don't bother in review. |
f2d9c9f
to
f4c2743
Compare
bump again |
Refactored close procedures to dispatch Errors for all components
Basically now it will always raise appropriate exceptions for any public calls after closure. Added ClientClosed and ServerClosed exceptions. Maybe they are a little to grained, your thoughts?
Now we can write:
and it will raise no matter where connection is lost.
Depends on #54. Please review that firts. I kinda split them in a way )