Firebird/Concepts: Difference between revisions
From stonehomewiki
Jump to navigationJump to search
Stonezhong (talk | contribs) |
Stonezhong (talk | contribs) |
||
| (6 intermediate revisions by the same user not shown) | |||
| Line 17: | Line 17: | ||
<div class="mw-collapsible-preview">wiring</div> | <div class="mw-collapsible-preview">wiring</div> | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
You can connect an output port to one | * You can connect an output port to one or more input ports. | ||
* When you emit data via an output port, the data gets sends to all the input port that is connected, and the node owns those input will receive the data. | |||
</div> | </div> | ||
</div> | </div> | ||
| Line 52: | Line 53: | ||
<b>method: on_message</b> | <b>method: on_message</b> | ||
<pre><nowiki> | <pre><nowiki> | ||
on_message(self, | on_message(self, port_id:str, data:Any) | ||
Called when this node receives data. | Called when this node receives data. port_id is the id of the port which receive the data, data is the JSON payload of the data. | ||
</nowiki></pre> | </nowiki></pre> | ||
| Line 109: | Line 110: | ||
type: Either PortType.INPUT or PortType.OUTPUT, represent it is a input port or output port | type: Either PortType.INPUT or PortType.OUTPUT, represent it is a input port or output port | ||
id: ID of the port, it is unique within the node | id: ID of the port, it is unique within the node | ||
node: The node which this port belongs to | |||
</nowiki></pre> | </nowiki></pre> | ||
| Line 128: | Line 129: | ||
<p></p> | <p></p> | ||
<div class="toccolours mw-collapsible mw-collapsed expandable"> | <div class="toccolours mw-collapsible mw-collapsed expandable"> | ||
<div class="mw-collapsible-preview">Pipeline</div> | <div class="mw-collapsible-preview">Pipeline</div> | ||
| Line 142: | Line 142: | ||
description: Detailed description of this pipeline. | description: Detailed description of this pipeline. | ||
mq: RabbitMQ instance | mq: RabbitMQ instance | ||
nodes: | nodes: Containing all node belongs to this pipeline. | ||
</nowiki></pre> | </nowiki></pre> | ||
| Line 152: | Line 152: | ||
</nowiki></pre> | </nowiki></pre> | ||
<b>method: <nowiki>[]</nowiki></b> | |||
<pre><nowiki> | <pre><nowiki> | ||
# You can use [] to get node by id | |||
pipeline["foo"] # get node with id "foo" of this pipeline | |||
# | |||
</nowiki></pre> | </nowiki></pre> | ||
< | </div> | ||
</div> | |||
<p></p> | |||
< | |||
<div class="toccolours mw-collapsible mw-collapsed expandable"> | |||
<div class="mw-collapsible-preview">RabbitMQ</div> | |||
<div class="mw-collapsible-content"> | |||
Represent a RabbitMQ connection | |||
</div> | </div> | ||
</div> | </div> | ||
<p></p> | <p></p> | ||
= Exception Handling = | |||
<div class="toccolours mw-collapsible mw-collapsed expandable"> | <div class="toccolours mw-collapsible mw-collapsed expandable"> | ||
<div class="mw-collapsible-preview"> | <div class="mw-collapsible-preview"></div> | ||
<div class="mw-collapsible-content"> | <div class="mw-collapsible-content"> | ||
* When you register a pipeline, 3 message queue will be created, they are | |||
* ${pipeline_name}: all the message gets routed here | |||
* ${pipeline_name}-error: when a message failed to process, it will be posted here, it has following fields: error_count, recent_errors: array of {failed_time, error_message} | |||
* ${pipeline_critical}-critical: when a message failed too many times, it will be moved here. | |||
</div> | </div> | ||
</div> | </div> | ||
<p></p> | <p></p> | ||
