class AsynchronousRenewableFileCacheReceiver(ParentReceiver): (source)
Constructor: AsynchronousRenewableFileCacheReceiver(bearer, max_retries)
Receiver that requests asynchronous renewals when needed.
The receiver delegates to the parent AsynchronousRenewableFileCacheBearer
for actual fetching and renewal coordination. It tracks a small retry
counter so transient errors can be retried a configurable number of times.
Example
Constructing a receiver is normally done via the bearer's
AsynchronousRenewableFileCacheBearer.receiver method:
receiver = async_bearer.receiver()
| Parameters | |
| bearer | The owning AsynchronousRenewableFileCacheBearer. |
| max | Maximum number of automatic retry attempts before giving up. |
| Method | __init__ |
Initialize the receiver. |
| Method | can |
Decide whether the caller should retry the operation. |
| Async Method | _fetch |
Fetch a token, forwarding to the parent bearer. |
| Instance Variable | _max |
Undocumented |
| Instance Variable | _parent |
Undocumented |
| Instance Variable | _trial |
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. |
Decide whether the caller should retry the operation.
The receiver inspects provided options and the internal trial count to decide whether to allow another retry. When retries are permitted and the operation was not requested synchronously the receiver will proactively request a background renewal via the parent bearer.
| Parameters | |
err:Exception | The exception that occurred during fetch. |
options:dict[ | Optional map of string options. Supported keys include
OPTION_RENEW_SYNCHRONOUS and OPTION_MAX_RETRIES which can
override synchronous behavior and the max retry count. |
| Returns | |
bool | True if the caller should retry, False otherwise. |
float | None = None, options: dict[ str, str] | None = None) -> Token:
(source)
¶
nebius.aio.token.token.Receiver._fetchFetch a token, forwarding to the parent bearer.
The method increments an internal trial count used by
can_retry and delegates the actual fetch to the parent
bearer's AsynchronousRenewableFileCacheBearer.fetch method.
| Parameters | |
timeout:float | None | Optional timeout forwarded to the parent fetch. |
options:dict[ | Optional fetch options forwarded to the parent. |
| Returns | |
Token | A Token instance. |