diff --git a/_includes/developing-flows-toc.html b/_includes/developing-flows-toc.html index d37ef948..91a5c578 100644 --- a/_includes/developing-flows-toc.html +++ b/_includes/developing-flows-toc.html @@ -8,7 +8,7 @@
  • Implementation
  • Readability
  • Project
  • -
  • Strict non-functional requirements
  • +
  • Non-functional requirements
  • diff --git a/docs/developing-flows/images/add-msg.parts-change-node.png b/docs/developing-flows/images/add-msg.parts-change-node.png new file mode 100644 index 00000000..feab118c Binary files /dev/null and b/docs/developing-flows/images/add-msg.parts-change-node.png differ diff --git a/docs/developing-flows/images/batch-node.png b/docs/developing-flows/images/batch-node.png new file mode 100644 index 00000000..c4e4a416 Binary files /dev/null and b/docs/developing-flows/images/batch-node.png differ diff --git a/docs/developing-flows/images/csv-node.png b/docs/developing-flows/images/csv-node.png new file mode 100644 index 00000000..4bb42ef6 Binary files /dev/null and b/docs/developing-flows/images/csv-node.png differ diff --git a/docs/developing-flows/images/join-node.png b/docs/developing-flows/images/join-node.png new file mode 100644 index 00000000..a1b9a95d Binary files /dev/null and b/docs/developing-flows/images/join-node.png differ diff --git a/docs/developing-flows/images/message-sequence.png b/docs/developing-flows/images/message-sequence.png new file mode 100644 index 00000000..ff7650e8 Binary files /dev/null and b/docs/developing-flows/images/message-sequence.png differ diff --git a/docs/developing-flows/images/method1.png b/docs/developing-flows/images/method1.png new file mode 100644 index 00000000..91fce071 Binary files /dev/null and b/docs/developing-flows/images/method1.png differ diff --git a/docs/developing-flows/images/method2.png b/docs/developing-flows/images/method2.png new file mode 100644 index 00000000..88267dd7 Binary files /dev/null and b/docs/developing-flows/images/method2.png differ diff --git a/docs/developing-flows/images/split-node.png b/docs/developing-flows/images/split-node.png new file mode 100644 index 00000000..9e6d4b85 Binary files /dev/null and b/docs/developing-flows/images/split-node.png differ diff --git a/docs/developing-flows/images/switch-node.png b/docs/developing-flows/images/switch-node.png new file mode 100644 index 00000000..3f987736 Binary files /dev/null and b/docs/developing-flows/images/switch-node.png differ diff --git a/docs/developing-flows/non-functional.md b/docs/developing-flows/non-functional.md index c56aa28c..9cdfb45f 100644 --- a/docs/developing-flows/non-functional.md +++ b/docs/developing-flows/non-functional.md @@ -1,23 +1,96 @@ --- layout: docs toc: developing-flows-toc.html -title: Responding to strict non-functional requirements +title: Responding to non-functional requirements --- -*Node-RED does not strongly focus on applications with strict non-functional requirements.* +{% comment %} +*Node-RED does not strongly focus on applications with non-functional requirements.* *However, there are cases that it is necessary to satisfy high level non-functional requirements.* *This chapter explains techniques and others to satisfy non-functional requirements.* - +{% endcomment %} + ### Precautions due to single thread - + +{% comment %} *If a node takes long time for execution, the process of the entire Node-RED instance stops.* *Therefore, it is advisable to outsource the processing with running other services.* - -### Sequential guarantee - +{% endcomment %} + +Because Node.js uses a single-thread execution model, execution of the entire Node-RED instance will stall if the execution of a node takes a long time. This causes the instance to hang. +Nodes whose processing is time-consuming should be executed in a different environment from Node-RED and called asynchronously. +This allows you to work around the issue in which Node-RED hangs. + +There are 2 methods to resolve. One way to call asynchronously is to use the `HTTP`node. +Place processing that requires a long time on another server, and place the `HTTP in/out` nodes before and after that processing. You can call in this way, but if it takes too long, there is a possibility that the processing will time out. + +
    + +
    + +The second way is to use the `mqtt` node. However, due to the function of the `mqtt` node, it is necessary to install the `MQTT broker` node. You can install it by searching `node-red-contrib-mqtt-broker` at Manage pallete menu. + +You should enter the port number and the required details in the `MQTT broker` node. And each `mqtt in` node is connected to `mqtt out` node that has same `topic` and `port`. It means you need to type the `topic` and `port` not only localhost but also other server, but you can freely control which nodes will send and receive messages. + +
    + +
    + +If processing is taking a long time because it is waiting for a condition to be met, we recommend that you use asynchronous programming in Node.js. + +### Guaranteeing the order of messages + +{% comment %} *Node - RED does not guarantee the arrival order of messages. Therefore, it is better to design related messages in a format expressing the order relation of messages. (Separated message format)* - - \ No newline at end of file +{% endcomment %} \ No newline at end of file