Skip to main content

Throttle

Emits an event from the input stream and then ignore emissions for wait milliseconds.

component image

In-ports

input <any> — input events to throttle.

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

Out-ports

output <any> — throttled events.

Overview

The Throttle operator emits an event from the input stream and then ignore emissions for wait milliseconds.

If the leading setting is enabled, the operator emits a value on the leading edge of the wait interval. If trailing is enabled, the operator emits a value on the trailing edge of the wait interval. Both settings are enabled by default.

Example 1

The following diagram demonstrates the Throttle operator with a wait period set to 3300 milliseconds.

throttle example 1

Example 2

The same example as above, but with a RESET signal sent at 5500 ms.

throttle 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)

Wait period in milliseconds.

Type: Number
Constraint: >= 0
Required: Yes

Leading (leading)

If enabled, the operator will emit a value on the leading edge of the wait interval.

Type: Boolean
Default: true
Required: No

Trailing (trailing)

If enabled, the operator will emit a value on the trailing edge of the wait interval.

Type: Boolean
Default: true
Required: No