-
Notifications
You must be signed in to change notification settings - Fork 74
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
refactor: add auto reconnect to curp client #972
base: master
Are you sure you want to change the base?
Conversation
Signed-off-by: bsbds <[email protected]>
* Removes unecessary async * Panics when url is ill-formed instead of returning an error Signed-off-by: bsbds <[email protected]>
Signed-off-by: bsbds <[email protected]>
Signed-off-by: bsbds <[email protected]>
Signed-off-by: bsbds <[email protected]>
Signed-off-by: bsbds <[email protected]>
Signed-off-by: bsbds <[email protected]>
Signed-off-by: bsbds <[email protected]>
Signed-off-by: bsbds <[email protected]>
Signed-off-by: bsbds <[email protected]>
Signed-off-by: bsbds <[email protected]>
The lock test uses time to sync two tokio tasks, which may cause problem becuase client propose may takes indefinite time. This commit refactor it to use a `Event` for sync instead. Signed-off-by: bsbds <[email protected]>
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #972 +/- ##
==========================================
- Coverage 75.55% 75.20% -0.35%
==========================================
Files 180 190 +10
Lines 26938 28426 +1488
Branches 26938 28426 +1488
==========================================
+ Hits 20353 21379 +1026
- Misses 5366 5747 +381
- Partials 1219 1300 +81 ☔ View full report in Codecov by Sentry. |
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.
What is the principle behind changing an async method to a sync one, or vice versa? Please squash these commits into one
/// Connect to a server | ||
async fn connect_to<Client: FromTonicChannel>( | ||
/// Creates a new connection | ||
fn connect_to<Client: FromTonicChannel>( |
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.
Why do you change this method from async to sync?
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.
The change_tx.send
is in a synchronous context, where a try_send
should never blocks. Therefore it is unecessary to use async here.
.await | ||
.into_iter() | ||
.collect::<Result<Vec<_>, _>>() | ||
/// Creates a new connection with auto reconnect |
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.
In what situation we need such a reconnect mechanism?
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.
Please refer to: hyperium/tonic#1254.
This PR includes two major changes:
Please briefly answer these questions:
what problem are you trying to solve? (or if there's no problem, what's the motivation for this change?)
what changes does this pull request make?
are there any non-obvious implications of these changes? (does it break compatibility with previous versions, etc)