AttestoClient.RefreshCoordinator (AttestoClient v2.2.0)

Copy Markdown View Source

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

option()

@type option() :: GenServer.option()

Functions

child_spec(init_arg)

Returns a specification to start this module under a supervisor.

See Supervisor.

run(server, key, fun, timeout_ms)

@spec run(GenServer.server(), term(), (-> term()), pos_integer()) :: term()

Run fun once for key, sharing its result with concurrent callers.

start_link(opts \\ [])

@spec start_link([option()]) :: GenServer.on_start()