CachedTokenProvider

class Object
trait Matchable
class Any

Value members

Concrete methods

def resource[F[_] : Temporal](underlying: TokenProvider[F], safetyPeriod: FiniteDuration, backgroundFailureHook: PartialFunction[Throwable, F[Unit]], onNewToken: Option[(AccessToken, FiniteDuration) => F[Unit]]): Resource[F, TokenProvider[F]]

Generate a cached token provider from an underlying provider.

Generate a cached token provider from an underlying provider.

Value parameters:
backgroundFailureHook

hook called if the background fiber refreshing the token fails

onNewToken

a callback invoked whenever a new token is generated, the scala.concurrent.duration.FiniteDuration is the period that will be waited before the next new token

safetyPeriod

how much time less than the indicated expiry to cache a token for; this is to give a safety buffer to ensure an expired token is never used in a request

underlying

the underlying token provider to use when a new token is required

Source:
CachedTokenProvider.scala