class documentation

class Cached(Resolver): (source)

Constructor: Cached(next)

View In Hierarchy

Memoizing resolver that caches results from another resolver.

The cache is in-memory and process-local. It grows as new service ids are resolved and never evicts entries (suitable for small sets of services).

Parameters
nextUnderlying resolver used when a value is not cached.
Method __init__ Undocumented
Method resolve Return a cached address or query the underlying resolver.
Instance Variable _cache Undocumented
Instance Variable _next Undocumented
def __init__(self, next: Resolver): (source)

Undocumented

def resolve(self, service_id: str) -> str: (source)

Return a cached address or query the underlying resolver.

Parameters
service_id:strService identifier to resolve.
Returns
strThe cached or newly resolved address.
Raises
UnknownServiceErrorpropagated from the underlying resolver when it does not match the id.

Undocumented

Undocumented