Represent a node in the pipeline. A node can have bunch of input ports and bunch of output ports. Each port has a unique id within the node.
Properties
id: The id of the node, it is unique within a pipeline
title: A human readable name of this node
description: Detailed description of this node
pipeline: The pipeline this node belongs to
input_port_ids: tuple of all input port ids
output_port_ids: tuple of all output port ids
input: The default input port
output: The default output port
Methods
def get_port(self, id:str) -> Optional["Port"]
# each port has a unique id within the node.
# return a port given port id
on_message(self, name:str, data:Any)
This method will be called for this node to handle data point, data is a json object, name represent from which port the data is received.
def connect(self, *dest_ports:Union["Node", "Port"]) -> "Port"
# connect the default output port to a input port of a node
# if dest_port element is a Node, then the default input port is used
def emit(self, data:Any, name:str=DEFAULT_PORT_NAME)
# emit data to it's output port specified by name