/
Parallel Processing Within Components

Parallel Processing Within Components

IguanaX components operate on a single thread or within a single Lua instance. This means that when a message is received by a component, it must complete the full execution of the main() function before the next message can be processed.

For workflows that require handling multiple simultaneous tasks, such as a multi-threaded web server managing concurrent connections, parallel processing is a powerful technique to improve efficiency and scalability. This approach is only suitable for when the order in which messages are processed is not important.

In IguanaX, parallel processing within components is achieved using the component.clone method to create multiple Lua instances (or threads) for processing. Messages can then be distributed across these threads with component.call, which invokes the main() function of the processing component and passes the data to be processed. Each thread processes messages independently, allowing for faster performance in high-throughput scenarios.

For an example use case, refer to the Web Service Multithread component.

 

Related content

Web Service Multithread Worker
Web Service Multithread Worker
More like this
Web Service Multithread
Web Service Multithread
More like this
Call a function within another Component
Call a function within another Component
Read with this
Introduction IguanaX's APIs
Introduction IguanaX's APIs
More like this
IguanaX Change Log
IguanaX Change Log
Read with this
Script Initialization (INIT Call)
Script Initialization (INIT Call)
More like this