2 ms·
This is effectively the solution I settled on this week for sharing and renewing an API token with multiple threads. ArcSwap protecting the (Token, Instant), a
by webstrand 1y ago
This is effectively the solution I settled on this week for sharing and renewing an API token with multiple threads. ArcSwap protecting the (Token, Instant), a mutex to prevent multiple simultaneous writers, and an additional barrier readers could optionally wait on, if they need a fresh token before the write is finished.