Sliding Window
Emits arrays containing the last n values from the input stream, where n is between min
and max
arguments.
In-ports
input <any>
— input events.
config JSON
(dynamic) — accepts a JSON object with configuration properties that can be set at runtime.
Out-ports
output Array
— arrays containing the last *n* values.
Overview
The Sliding Window operator collects incoming events on the input stream and emits arrays containing the last n values, where n is between the min
and max
arguments specified in settings.
To reset the window, send a RESET signal.
Example 1
This example applies the Sliding Window operator to a stream of integer values, with a window size of minimum 2 and a maximum of 3 values.
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.
Min (min
)
Minimum size of a sliding window.
Type: Number
Constraint: >= 1
Required: Yes
Max (max
)
Maximum size of a sliding window.
Type: Number
Constraint: >= 1
Required: Yes