1
0
mirror of https://github.com/node-red/node-red.git synced 2023-10-10 13:36:53 +02:00

43 lines
3.8 KiB
HTML
Raw Normal View History

<!--
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
2023-07-10 21:48:15 +08:00
<script type="text/html" data-help-name="delay">
<p>对通过节点的消息进行延迟发送或限制。</p>
<h3>输入</h3>
<dl class="message-properties">
<dt class="optional">delay <span class="property-type">数值</span></dt>
<dd>设置要应用于消息的延迟(以毫秒为单位)。仅当节点配置为允许消息去覆盖配置的默认延迟间隔时,此选项才适用。</dd>
2023-07-10 21:48:15 +08:00
<dt class="optional">rate <span class="property-type">数值</span></dt>
<dd>设置消息之间的速率值(以毫秒为单位)。 当该节点收到包含 <code>msg.rate</code> 值(以毫秒为单位)的消息时,它会覆盖节点配置中定义的现有速率值。 仅当节点配置为允许消息覆盖配置的默认速率间隔时,此选项才适用。</dd>
<dt class="optional">reset</dt>
<dd>如果接收到的消息将此属性设置为任何值,则将清空该节点保留的所有的未发送消息。</dd>
<dt class="optional">flush</dt>
2023-07-10 21:48:15 +08:00
<dd>如果收到的消息将此属性设置为数值,则将立即释放该多条消息。 如果设置为任何其他类型(例如布尔值),则立即发送节点持有的所有未完成的消息。</dd>
<dt class="optional">toFront</dt>
<dd>在速率限制模式下,如果收到的消息将此属性设置为布尔值<code>true</code>,则该消息将被推送到队列的前面,然后将被释放。 这可以与 <code>msg.flush=1</code> 结合使用以立即重新发送。
</dd>
</dl>
<h3>详细</h3>
<p>当配置为延迟发送消息时,延迟间隔可以是一个固定值,一个范围内的随机值或为每个消息动态设置。</p>
<p>当配置为对消息进行限制时,它们的传递将分散在配置的时间段内。状态显示队列中当前的消息数。可以选择在中间消息到达时丢弃它们。</p>
<p>速率限制可以应用于所有消息,也可以根据<code>msg.topic</code>的值来进行分组。分组时,中间消息将会被自动删除。在每个时间间隔,节点可以释放所有主题的最新消息,或释放下一个主题的最新消息。</p>
2023-07-10 21:48:15 +08:00
<p>当配置为延迟消息时,延迟间隔可以是固定值、一定范围内的随机值或为每个消息动态设置。 每条消息都会根据其到达时间独立于任何其他消息进行延迟。 </p>
<p>当配置为限制消息速率时,它们的传递将分布在配置的时间段内。 状态显示当前队列中的消息数。 它可以选择在中间消息到达时丢弃它们。</p>
<p>如果设置为允许覆盖速率,则新速率将立即应用,并将一直有效,直到再次更改、重置节点或重新启动流程。</p>
<p>速率限制可以应用于所有消息,或根据其 <code>msg.topic</code> 值对它们进行分组。 分组时,中间消息会自动丢弃。 在每个时间间隔,节点可以发布所有主题的最新消息,或者发布下一个主题的最新消息。 </p>
<p><b>注意</b>:在速率限制模式下,可以通过 <i>settings.js</i> 文件中的属性设置最大队列深度。 例如<code>nodeMessageBufferMaxLength1000</code></p>
</script>