Automation Utilities

This module provides a set of automated utilities specifically designed for creating and managing ChaskiNode instances. These utilities streamline the setup of distributed node communication and coordination systems.

async chaski.utils.auto.create_nodes(subscriptions: int | List[str], ip: str = '127.0.0.1', port: int = 0) List[ChaskiNode][source]

Create a list of ChaskiNode instances.

This function generates a list of ChaskiNode instances with the given number of nodes or subscriptions. If an integer is provided for subscriptions, the first n letters of the alphabet will be used as default subscription topics. Each node will run on a sequentially incremented port starting from the given port number.

Parameters:
  • subscriptions (Union[int, List[str]]) – The number of nodes to create if an integer is provided. If a list of strings is provided, each string represents a subscription topic for a node.

  • ip (str, optional) – The IP address where the nodes will bind to, by default ‘127.0.0.1’.

  • port (int, optional) – The starting port number for the nodes, by default PORT.

Returns:

A list of ChaskiNode instances.

Return type:

List[ChaskiNode]

async chaski.utils.auto.run_transmission(producer, consumer, parent=None)[source]