Firebird: Difference between revisions

From stonehomewiki
Jump to navigationJump to search
Line 100: Line 100:
<div class="mw-collapsible-preview">Pipeline</div>
<div class="mw-collapsible-preview">Pipeline</div>
<div class="mw-collapsible-content">
<div class="mw-collapsible-content">
Represent a pipeline, which has
* bunch of nodes
* A node's output port can connect to another node's input port
Properties:
* mq: message queue
* node_dict: dictionary, key is node name, value is node
Methods:
<pre><nowiki>
def message_loop(self):
# enters a message loop, allow each node to process data
</nowiki></pre>
<pre><nowiki>
def add_node(self, name:str, node_class, *argc, **kwargs)
# add a node to the pipeline, *argc, and **kwargs will be passed to the constructor
</nowiki></pre>
<pre><nowiki>
def connect(self, *, src_node_name, src_port_name=DEFAULT_PORT_NAME, dst_node_name, dst_port_name=DEFAULT_PORT_NAME)
# connect one node's output port to another node's input port
</nowiki></pre>
</div>
</div>
</div>
</div>

Revision as of 07:18, 17 April 2023

Firebird -- Python based Streaming Framework

APIs