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

Add on_reconnect callback on the async client #405

Merged
merged 2 commits into from
Mar 28, 2024

Conversation

rageshkrishna
Copy link
Contributor

Async clients that are using the reconnect feature can now provide an optional callback that will be invoked before the server is reconnected. You may optionally update the address or auth settings in this callback and they will be applied when the client reconnects.

This is useful for updating auth tokens which may have expired by the time a reconnection is required.

Fixes #401

Async clients that are using the reconnect feature can now provide an
optional callback that will be invoked before the server is reconnected.
You may optionally update the address or auth settings in this callback
and they will be applied when the client reconnects.

This is useful for updating auth tokens which may have expired by the
time a reconnection is required.
Copy link

codecov bot commented Mar 26, 2024

Codecov Report

Attention: Patch coverage is 88.23529% with 8 lines in your changes are missing coverage. Please review.

Project coverage is 91.95%. Comparing base (5ae3d4d) to head (f7df753).

Files Patch % Lines
socketio/src/asynchronous/client/client.rs 88.37% 5 Missing ⚠️
socketio/src/asynchronous/client/callback.rs 78.57% 3 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main     #405   +/-   ##
=======================================
  Coverage   91.95%   91.95%           
=======================================
  Files          36       36           
  Lines        5007     5073   +66     
=======================================
+ Hits         4604     4665   +61     
- Misses        403      408    +5     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rageshkrishna
Copy link
Contributor Author

Hi @1c3t3a! Just checking if you had a chance to look at this. Let me know if you need any changes. Thanks.

Copy link
Owner

@1c3t3a 1c3t3a left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! This looks great, thanks a lot! :)

@1c3t3a 1c3t3a merged commit 7568572 into 1c3t3a:main Mar 28, 2024
4 checks passed
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 this pull request may close these issues.

Allow async connections to update auth when reconnecting
2 participants