Single-flight coordinator for refresh-token rotation.
Concurrent refreshes for the same application-supplied key share exactly one operation and receive the same result. Different keys run independently. A deadline kills a stuck operation, wakes every waiter, and clears the key for a later attempt.
The key should identify the application's token record without containing a token secret. This process does not store token sets after an operation; callers must atomically persist successful rotation results according to their own retention policy.
Summary
Functions
Returns a specification to start this module under a supervisor.
Run fun once for key, sharing its result with concurrent callers.
Types
@type option() :: GenServer.option()
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec run(GenServer.server(), term(), (-> term()), pos_integer()) :: term()
Run fun once for key, sharing its result with concurrent callers.
@spec start_link([option()]) :: GenServer.on_start()