crepererum commented on PR #542:
URL:
https://github.com/apache/arrow-rs-object-store/pull/542#issuecomment-3515679001
Also looking at the code, you roughly have something like this:
```
if token_fresh() {
return token;
}
let _guard = refresh.lock().await;
...
write_token();
```
I don't see how an `ArcSwap` is really gonna help here. In fact with that
construct the `RwLock` doesn't even need to be a tokio async lock. You can just
use a stdlib or parking_lot `RwLock` since getting the fresh token doesn't
involve I/O and replacing it while being under the refresh guard at the very
end is also just a sync write operation.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]