Skip to main content

Take

Emits the first count events from the input stream, then stops.

component image

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 <any> — output events.

Overview

The Take operator emits the first count events from the input stream, and then stops emitting all subsequent events.

To reset the operator, send a RESET signal.

Example 1

This example applies the Take operator to a stream of integer values, taking the initial 3 events. It then takes another 3 events after the RESET signal.

take example 1

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.

Count (count)

The number of events to take from the beginning.

Type: Number
Constraint: >= 0
Required: Yes

Configuration object

Here is an example of a configuration object that you can use as a template:

{
"count": 2
}