Async and Await Feature of New ForEach Node in Kumologica
In this article, I will be demonstrating the new ForEach and ForEach End node introduced in the latest 2.1.3 release of Kumologica Designer.
Join the DZone community and get the full member experience.Join For Free
In this article, I will be demonstrating the new ForEach and ForEach End node introduced in the latest 2.1.3 release of Kumologica Designer. In the earlier version of Kumologica, looping was achieved using a processor node. The implementation of looping has been made a lot more easier with the introduction of ForEach node.
The ForEach node has two modes of operation which are described below:
Async is the default behavior in the ForEach node. In this mode, each iteration will not wait for the previous iteration to complete. This means that iteration execution will be faster no iterations are waiting. This iteration mode of ForEach is really good for those service which are heavily focussed on performance. In this mode the iteration will not be maintaining any sequence a record processing.
In this mode, each iteration will be waiting for the previous iteration to complete. This means execution will be comparatively slower when compared to Async mode. This iteration mode is specifically used for those services that are focussed on sequence of record processing. A strict sequence is maintained when the ForEach node is executed in this mode.
How to use the two modes of operation in Kumologica?
The following video shows how to use the ForEach node in Async mode (default).
All the individual records are printed immediately on the logs as they were all asynchronously processed without any blocking.
Following video shows how to ForEach node in Await mode. To enable the Await mode of operation. Enable the checkbox provide in the ForEach node setting.
All the individual records are printed one after the other in sequence onto the logs as each record was waiting for its iteration process to complete before the next iteration.
Opinions expressed by DZone contributors are their own.