-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add ready attribute, when exchange is ready #2
Comments
Witnessed exception classes
ConnectionWrongStateError also witnessed with "BlockingConnection.close(200, 'Normal shutdown') called on closed connection." – I assume this is yapw attempting a clean shutdown after one of the above unhandled exceptions. |
This has been implemented in clients. Different clients might want to recover from different errors (and instantiate different clients), so it might be over-complicated to make this reusable in this library, as we'd need to pass the new function a "client factory". |
Noting that we might need to set a "ready" state like we do in Kingfisher Collect and then only run functions when ready. We can do this as a new function that calls It might be as simple as changing add_callback_threadsafe to check the ready state: |
Re-opening to upstream the Kingfisher Collect logic, essentially: class Client(Async):
def __init__(self, **kwargs):
super().__init__(**kwargs)
self.ready = False
def exchange_ready(self):
self.ready = True
def reset(self):
super().reset()
self.ready = False Then document the |
Relevant code: https://github.com/pika/pika/blob/55557c9172edb04256a5e49b7faf13078d5a0f66/examples/blocking_consume_recover_multiple_hosts.py#L54-L63
The text was updated successfully, but these errors were encountered: