Skip to content
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

[async client]: add notify_on_disconnect hook when the connection is closed #770

Closed
Tracked by #736
niklasad1 opened this issue May 13, 2022 · 0 comments · Fixed by #837
Closed
Tracked by #736

[async client]: add notify_on_disconnect hook when the connection is closed #770

niklasad1 opened this issue May 13, 2022 · 0 comments · Fixed by #837
Assignees

Comments

@niklasad1
Copy link
Member

niklasad1 commented May 13, 2022

We already have an API for is_connected but I imagine it would be easier for folks to have future/callback that fires when the connection has been closed instead of polling this function in an async context.

So would nice neat to have an API:

/// Returns only if the connection has been disconnected.
///
/// Should be cancel-safe if possible
async fn notify_on_disconnect() { } 
@niklasad1 niklasad1 changed the title [async client]: add callback when the connection is closed [async client]: add notify_on_disconnect hook when the connection is closed May 13, 2022
@niklasad1 niklasad1 mentioned this issue May 16, 2022
9 tasks
@jsdw jsdw added this to the v1.0 milestone Jun 17, 2022
@lexnv lexnv self-assigned this Aug 3, 2022
@jsdw jsdw removed this from the v1.0 milestone Aug 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants