-
Notifications
You must be signed in to change notification settings - Fork 333
imapclient: implement Client.Closed #721
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
base: v2
Are you sure you want to change the base?
Conversation
|
I've implemented by particular case in some other way, but this sounds useful to have. I have no strong objections if you'd prefer to close this PR. |
|
I was wondering about the use-case for this. I initially thought I needed something similar for alps, but then figured it wouldn't help much:
|
The channel is not intended to be checked before sending a message, but to re-connect automatically when the connection terminates (i.e.: in the case of NOTIFY). |
|
Previously, the Notify.Overflow channel in #718 would also be closed when the connection dropped (a convenient side-effect). This allowed me to detect when a connection had been closed. Having switched NOTIFY to use a UnilateralDataHandler for NOTIFYOVERFLOW events, I once again need this feature. I don't think I have any other way of detecting when the connection has been closed. I'm only waiting for NOTIFY events, so never send any messages. |
|
Hm, right, that's a good point. I think NOTIFY is special here: with IDLE, clients could call |
Implement a Client.Closed() to be used by clients to monitor when a connection is closed.
Implement a Client.Closed() to be used by clients to monitor when a connection is closed.