Iterator
Allows to perform asynchronous operations inside the loop.
In-ports
input <any>
— the array to iterate through. Input values, which are not arrays, will be treated as an array of one element.
next <any>
— instructs the component to emit the next element of the array.
Out-ports
begin Boolean
— emits true
to trigger an operation before the iteration starts.
output <any>
— emits the next element of the input array.
end Boolean
— emits true
indicating that the last element of the array is reached.
Overview
The purpose of Iterator is to provide a mechanism for asynchronously iterating through the elements of an input array. Each iteration can be suspended to perform asynchronous operation before moving on to the next element.
The start of the iteration is always preceded by sending of an event by the begin port. This event can be used to initiate an operation that you want to perform on elements of the input array. Emitting each element on the output port, including the first, must be triggered by an event on the next port. After the last element of the array is reached, the end port emits true
.
Several arrays sent to Iterator will be queued and processed in the order they are received.
Settings
No additional configuration is required.