minos.networks.discovery.clients.abc module

class minos.networks.discovery.clients.abc.DiscoveryClient(host, port)[source]

Bases: abc.ABC

Minos Discovery Client class.

__init__(host, port)[source]
property route: str

Get the full http route to the repository.

Return type

str

Returns

An str value.

abstract async subscribe(host, port, name, endpoints, retry_tries=3, retry_delay=5)[source]

Perform a 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.

  • retry_tries (int) – Number of attempts before raising a failure exception.

  • retry_delay (float) – Seconds to wait between attempts.

Return type

None

Returns

This method does not return anything.

abstract async unsubscribe(name, retry_tries=3, retry_delay=5)[source]

Perform an unsubscribe query.

Parameters
  • name (str) – The name of the microservice to be unsubscribed.

  • retry_tries (int) – Number of attempts before raising a failure exception.

  • retry_delay (float) – Seconds to wait between attempts.

Return type

None

Returns

This method does not return anything.