class documentation

class PureFileCacheReceiver(ParentReceiver): (source)

Constructor: PureFileCacheReceiver(cache)

View In Hierarchy

Receiver that reads tokens from a ThrottledTokenCache.

Behavior

  • _fetch returns the token stored in the cache or nebius.aio.token.token.Token.empty when no token exists.
  • can_retry returns False; callers should not apply transport retries to a local file cache.
Parameters
cacheThrottled token cache implementation.
Method __init__ Create a receiver backed by cache.
Method can_retry Return False to indicate no retries should be attempted.
Async Method _fetch Return the cached token or an empty token.
Instance Variable _cache Undocumented

Inherited from Receiver:

Async Method fetch Fetch a token and record it as the latest value.
Property latest Return the latest fetched token or None.
Instance Variable _latest The most recently fetched token, or None if no token has been fetched yet. Implementations may update this to support inspection or caching by callers.
def __init__(self, cache: ThrottledTokenCache): (source)

Create a receiver backed by cache.

No file I/O occurs during construction; the cache performs I/O on demand.

def can_retry(self, err: Exception, options: dict[str, str] | None = None) -> bool: (source)

Return False to indicate no retries should be attempted.

Parameters
err:ExceptionThe exception raised during a prior fetch attempt.
options:dict[str, str] | NoneOptional receiver options (unused).
Returns
boolAlways False.
async def _fetch(self, timeout: float | None = None, options: dict[str, str] | None = None) -> Token: (source)

Return the cached token or an empty token.

Parameters
timeout:float | NoneIgnored. Present for interface compatibility.
options:dict[str, str] | NoneUnused by this receiver.
Returns
TokenToken from the underlying cache or an empty token.

Undocumented