Skip to main content

Buffer With Time

Buffers all values from the input port and flushes the buffer every wait milliseconds. Also, peeks at the buffer on each event from the peek port without flushing it.

component image

In-ports

input <any> — input events to buffer.

peek <any> — events to peek at the buffer.

config JSON (dynamic) — accepts a JSON object with configuration properties that can be set at runtime.

Out-ports

output <Array> — Outputs an array of buffered values.

Overview

The Buffer With Time operator buffers all values from the input port and flushes the buffer every wait milliseconds. If the count is configured, the operator will also flush the buffer once that limit is reached. You can also use the peek port to peek at the buffer without flushing it.

To reset the buffer without outputting its contents, send a RESET signal to the input port.

Example 1

The wait is set to 3300 ms.

buffer with time example 1

Example 2

The wait is set to 3300 ms and the count is set to 2.

buffer with time example 2

Settings

Enable realtime config port

If this setting is enabled, the component can be configured through the config port. This port accepts a configuration object as input and allows you to set dynamic properties at runtime. Note that using this port does not cause the component to reinitialize, but it may cause some previous state of the component to be lost.

Wait (wait)

The time interval in milliseconds that must pass before the buffer is flushed.

Type: Number
Constraint: >= 0
Required: Yes

Count (count)

The maximum number of events that can be stored in the buffer before it is flushed.

Type: Number
Constraint: >= 0
Required: No