minos.plugins.minos_discovery.client
Classes
Minos Discovery Client class. |
- class MinosDiscoveryClient[source]
Bases:
DiscoveryClient
,CircuitBreakerMixin
Minos Discovery Client class.
- async subscribe(host, port, name, endpoints, *args, **kwargs)[source]
Perform the subscription query.
- Parameters
host (str) – The ip of the microservice to be subscribed.
port (int) – The port of the microservice to be subscribed.
name (str) – The name of the microservice to be subscribed.
endpoints (list[dict[str, str]]) – List of endpoints exposed by the microservice.
args – Additional positional arguments.
kwargs – Additional named arguments.
- Returns
This method does not return anything.
- Return type
None
- async unsubscribe(name, *args, **kwargs)[source]
Perform the unsubscription query.
- Parameters
name (str) – The name of the microservice to be unsubscribed.
args – Additional positional arguments.
kwargs – Additional named arguments.
- Returns
This method does not return anything.
- Return type
None
- property circuit_breaker: aiomisc.circuit_breaker.CircuitBreaker
Get the circuit breaker.
- Returns
A
CircuitBreaker
instance.
- property circuit_breaker_exceptions: tuple[type[Exception]]
Get the circuit breaker exceptions.
- Returns
A tuple of
Exception
types.
- async destroy()
Destroy miscellaneous repository things.
- Returns
This method does not return anything.
- Return type
None
- classmethod from_config(config=None, **kwargs)
Build a new instance from config.
- Parameters
config (Optional[Union[Config, Path]]) – Config instance. If None is provided, default config is chosen.
kwargs – Additional named arguments.
- Returns
A instance of the called class.
- Return type
S
- property is_circuit_breaker_broken: bool
Check if circuit breaker is passing.
- Returns
A
bool
instance.
- property is_circuit_breaker_passing: bool
Check if circuit breaker is passing.
- Returns
A
bool
instance.
- property is_circuit_breaker_recovering: bool
Check if circuit breaker is passing.
- Returns
A
bool
instance.
- async setup()
Setup miscellaneous repository things.
- Returns
This method does not return anything.
- Return type
None