message

class MessageType(*values)[source]
announce = 'announce'
identify = 'identify'
process = 'process'
init = 'init'
deinit = 'deinit'
ping = 'ping'
start = 'start'
status = 'status'
stop = 'stop'
event = 'event'
error = 'error'
epoch_ended = 'epoch_ended'
class NodeStatus(*values)[source]
stopped = 'stopped'

Node is deinitialized - does not have an instantiated node, etc., but is responsive.

waiting = 'waiting'

Node is waiting for its dependency nodes to be ready

ready = 'ready'

Node is ready to process events

running = 'running'

Node is running in free-run mode. Note that we do not update status for every process call at the moment, as that level of granularity is not relevant to the command node when sending commands

closed = 'closed'

Node is permanently gone, should not be expected to respond to further messages.

pydantic model Message[source]
Config:
  • use_enum_values: bool = True

  • validate_by_alias: bool = True

  • serialize_by_alias: bool = True

Fields:
field node_id: str [Required]
field timestamp: datetime [Optional]
field type_: MessageType [Required] (alias 'type')
field value: Any = None
classmethod from_bytes(msg: list[bytes]) Message[source]
to_bytes() bytes[source]
class IdentifyValue[source]
node_id: str
outbox: str
status: NodeStatus
signals: list[str] | None
slots: list[str] | None
class AnnounceValue[source]
inbox: str
nodes: dict[str, IdentifyValue]
class ErrorValue[source]
err_type: type[Exception]
err_args: tuple
traceback: str
class ProcessValue[source]
epoch: Epoch
input: dict | None
pydantic model AnnounceMsg[source]

Command node ‘announces’ identities of other peers and the events they emit

Config:
  • use_enum_values: bool = True

  • validate_by_alias: bool = True

  • serialize_by_alias: bool = True

Fields:
field type_: Literal[MessageType.announce] = MessageType.announce (alias 'type')
field value: AnnounceValue [Required]
pydantic model IdentifyMsg[source]

A node sends its configuration to the command node on initialization

Config:
  • use_enum_values: bool = True

  • validate_by_alias: bool = True

  • serialize_by_alias: bool = True

Fields:
field type_: Literal[MessageType.identify] = MessageType.identify (alias 'type')
field value: IdentifyValue [Required]
pydantic model PingMsg[source]

Request other nodes to identify themselves and report their status

Config:
  • use_enum_values: bool = True

  • validate_by_alias: bool = True

  • serialize_by_alias: bool = True

Fields:
field type_: Literal[MessageType.ping] = MessageType.ping (alias 'type')
field value: None = None
pydantic model ProcessMsg[source]

Process a single iteration of the graph

Config:
  • use_enum_values: bool = True

  • validate_by_alias: bool = True

  • serialize_by_alias: bool = True

Fields:
field type_: Literal[MessageType.process] = MessageType.process (alias 'type')
field value: ProcessValue [Required]

Any process-scoped input passed to the process call

pydantic model InitMsg[source]

Initialize nodes within node runners

Config:
  • use_enum_values: bool = True

  • validate_by_alias: bool = True

  • serialize_by_alias: bool = True

Fields:
field type_: Literal[MessageType.init] = MessageType.init (alias 'type')
field value: None = None
pydantic model DeinitMsg[source]

Deinitializes nodes within node runners

Config:
  • use_enum_values: bool = True

  • validate_by_alias: bool = True

  • serialize_by_alias: bool = True

Fields:
field type_: Literal[MessageType.deinit] = MessageType.deinit (alias 'type')
field value: None = None
pydantic model StartMsg[source]

Start free-running nodes

Config:
  • use_enum_values: bool = True

  • validate_by_alias: bool = True

  • serialize_by_alias: bool = True

Fields:
field type_: Literal[MessageType.start] = MessageType.start (alias 'type')
field value: int | None = None
pydantic model StatusMsg[source]

Node updating its current status

Config:
  • use_enum_values: bool = True

  • validate_by_alias: bool = True

  • serialize_by_alias: bool = True

Fields:
field type_: Literal[MessageType.status] = MessageType.status (alias 'type')
field value: NodeStatus [Required]
pydantic model StopMsg[source]

Stop processing

Config:
  • use_enum_values: bool = True

  • validate_by_alias: bool = True

  • serialize_by_alias: bool = True

Fields:
field type_: Literal[MessageType.stop] = MessageType.stop (alias 'type')
field value: None = None
pydantic model ErrorMsg[source]

An error occurred in one of the processing nodes

Config:
  • use_enum_values: bool = True

  • validate_by_alias: bool = True

  • serialize_by_alias: bool = True

  • arbitrary_types_allowed: bool = True

Fields:
field type_: Literal[MessageType.error] = MessageType.error (alias 'type')
field value: Annotated[ErrorValue, BeforeValidator(func=_from_jsonable_pickle, json_schema_input_type=PydanticUndefined), WrapSerializer(func=_to_jsonable_pickle, return_type=PydanticUndefined, when_used=json)] [Required]
Constraints:
  • func = <function _to_jsonable_pickle at 0x776e569c1a80>

  • json_schema_input_type = PydanticUndefined

  • return_type = PydanticUndefined

  • when_used = json

to_exception() Exception[source]
pydantic model EpochEndedMsg[source]

Command node is signaling that an epoch has been completed to all nodes, which don’t have a complete picture of the tube’s state.

Config:
  • use_enum_values: bool = True

  • validate_by_alias: bool = True

  • serialize_by_alias: bool = True

Fields:
field type_: Literal[MessageType.epoch_ended] = MessageType.epoch_ended (alias 'type')
field value: Epoch [Required]
pydantic model EventMsg[source]
Config:
  • use_enum_values: bool = True

  • validate_by_alias: bool = True

  • serialize_by_alias: bool = True

Fields:
field type_: Literal[MessageType.event] = MessageType.event (alias 'type')
field value: list[Annotated[Annotated[Event, AfterValidator(func=_meta_signals_to_enum), Tag(tag=event)] | Annotated[MetaEvent, Tag(tag=meta)], Discriminator(discriminator=_type_discriminator, custom_error_type=None, custom_error_message=None, custom_error_context=None)]] [Required]