-
Notifications
You must be signed in to change notification settings - Fork 224
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
feat: manual shutdown of client #4492
Conversation
ffed3b4
to
99ab9d5
Compare
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 merge-base changed after approval.
Followup: #4535 |
fedimint-client/src/lib.rs
Outdated
fedimint_core::task::sleep(Duration::from_millis(10)).await; | ||
/// Shutdown the client. | ||
/// Returns false if there are other clones of [`ClientHandle`]. | ||
pub async fn shutdown(self) -> bool { |
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.
I feel like this should return a result...
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.
maybe Result<(), ClientHandle>
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.
Yeap.
BTW. That Client
with stopped reactor is an extra flag and state, that I'm not sure if it's useful for anything ever. Maybe we should cut it. It's easier if "handle exist == it's running" always holds.
So maybe all you can do is "drop" (shutdown), or "restart"? And then shutting down would be infallable? @maan2003
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.
makes sense
85216a7
to
4fb5f1c
Compare
4fb5f1c
to
3ee4640
Compare
on top #4484