Graph Communication

Contents

Graph Communication#

class caskade.Memo(module: Node, memo: str)[source]#

Sends a “memo” (a small message) to all nodes below the current one in the graph. This can be used to communicate state changes in the graph with all lower nodes. By default, the message will skip any subgraphs (hierarchical graphs) but this can be changed to ensure all nodes hear the message.

Note that memos are stored as a python set, so duplicates will be merged. Depending on your use case, it may be wise to ensure that your memo is unique.

Parameters:
  • module (Module) – The caskade Module object that will propogate the memo

  • memo (str) – The message to send down the graph

  • skip_subgraphs (bool) – If True (default) any subgraphs, otherwise known as hierarchical graphs, will not get the memo.