class documentation

class Constant(Resolver): (source)

Constructor: Constant(address)

View In Hierarchy

Resolver that always returns a fixed address.

Useful for testing or when all services are routed through a single endpoint.

Parameters
addressAddress string that will be returned for any id.
Method __init__ Undocumented
Method resolve Return the configured address for any service_id.
Instance Variable _address Undocumented
def __init__(self, address: str): (source)

Undocumented

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

Return the configured address for any service_id.

This implementation never raises UnknownServiceError.

Parameters
service_id:strService identifier to resolve (ignored).
Returns
strThe configured address.
_address = (source)

Undocumented