buffer

Buffering input data.

Description

  • Buffering input data.

  • The child nodes are processed either when the data exceeds the buffer size or after a certain amount of time has passed. At that point, the buffer data is written to the FlowData.

Parameters

Parameter

Type

Required

Default

Comment

flatten

bool

No

False

When flatten is True, the input list is flattened before being stored in the buffer.

input

Any

Yes

-

Input data to be buffered.

size

int

No

50

Buffer size.

timeout

float

No

5.0

The waiting period for new data to arrive.

If this period expires, the child nodes are processed.

If the input data exceeds the buffer size, the child nodes are processed immediately.

Examples

# Buffer for scalar data
- buffer:
    name: "buffer"
    size: 10
    timeout: 5
    input: "{{ fd.input }}"

# Buffer for list data with flatten
- buffer:
    name: "buffer"
    size: 10
    timeout: 5
    input: "{{ fd.input }}"
    flatten: yes