minos.networks.brokers.clients
Classes
Broker Client class. |
- class BrokerClient[source]
Bases:
SetupMixin
Broker Client class.
- __init__(topic, publisher, subscriber, **kwargs)[source]
- Parameters
topic (str) –
publisher (BrokerPublisher) –
subscriber (BrokerSubscriber) –
- async send(message)[source]
Send a
BrokerMessage
.- Parameters
message (BrokerMessage) – The message to be sent.
- Returns
This method does not return anything.
- Return type
None
- async receive(*args, **kwargs)[source]
Get one handler entry from the given topics.
- Parameters
args – Additional positional parameters to be passed to receive_many.
kwargs – Additional named parameters to be passed to receive_many.
- Returns
A
HandlerEntry
instance.- Return type
- async receive_many(count, timeout=60, **kwargs)[source]
Get multiple handler entries from the given topics.
- Parameters
- Returns
A list of
HandlerEntry
instances.- Return type
- 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
- async setup()
Setup miscellaneous repository things.
- Returns
This method does not return anything.
- Return type
None