-
Notifications
You must be signed in to change notification settings - Fork 0
refactor: make token a watch channel #39
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
Conversation
This stack of pull requests is managed by Graphite. Learn more about stacking. |
11a4528
to
5b84070
Compare
e2fe90e
to
b26969b
Compare
5b84070
to
1037b24
Compare
/// blocking, panics, errors, and cancel safety. However, it uses a clone | ||
/// of the [`watch::Receiver`] and will not update the local view of the | ||
/// channel. |
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 actual plus for this fn is that this:
- does not produce a potentially blocking borrow for the sender half no? (as the secret is inspected and the ownership is transferred, this is safe to hold for a longer amount of time)
- does not mark the actual token value as seen for all subsequent copies of the channel until the token is refreshed, as the receiver is cloned
no?
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.
does not mark the actual token value as seen for all subsequent copies of the channel until the token is refreshed, as the receiver is cloned
this is not really relevant, as we don't have any situations where we wait for the next updated token. We always care only about the immediate value. If we hypothetically wanted to take some action on token refresh, we would care about updating
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 see the actual + for this function compared to the previous version with the rwlock that you can .await
it before auth has been completed
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 other thing here is not requiring &mut
. documenting that it won't update the channel is more about letting people know a side effect of using &self
. We don't want consumers to need &mut
please don't add merge commits they make it harder to resolve issues when things go wrong |
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.
lgtm
412711a
to
192b1b5
Compare
192b1b5
to
d0077f3
Compare
No description provided.