Skip to main content

spawn_refresher

Function spawn_refresher 

Source
pub fn spawn_refresher(
    creds: Arc<CachingCredentials>,
    clock: Arc<dyn Fn() -> u64 + Send + Sync>,
    interval: Duration,
)
Expand description

Spawn a background task that calls CachingCredentials::refresh_due every interval, using clock for the current time. Priming and rotation both flow through it. The task lives for the process; it is dropped when the runtime shuts down.