Skip to content

Commit

Permalink
added doc for peer-stopping
Browse files Browse the repository at this point in the history
  • Loading branch information
ProKil authored Dec 13, 2024
1 parent 210759e commit 08b620c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/aact/nodes/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,19 @@ async def __aexit__(self, exc_type: Any, exc_value: Any, traceback: Any) -> None
[^1]: Only if you know what you are doing. For example, in the `aact.nodes.record.RecordNode`, the `InputType` is
`aact.messages.DataModel` because it can accept any type of message. But in most cases, you should specify the
`InputType` and `OutputType` to be a specific subclass of `aact.messages.DataModel`.
### Shutdown nodes
The default method for stopping nodes is through shutting down the subprocesses or RQ jobs. When you want to bring
down the dataflow, you can `Ctrl + c` to turn off the nodes gracefully.
To shutdown a node itself, you can return from its event loop programatically when a certain condition is reached.
#### Experimental feature: Peer-stopping
An experimental feature is peer-stopping. A node can not only stop itself but also other nodes. To do this, send
a message to the channel `f"shutdown:{self.node_name}"` and the node manager will shutdown all of the nodes in the
current dataflow.
"""

input_channel_types: dict[str, Type[InputType]]
Expand Down

0 comments on commit 08b620c

Please sign in to comment.