RUAL Documentation

Queue / Task manager

We offer a queue feature in our system, and it's important to understand when and how to effectively utilize it.

Understanding Queues

For large-scale system development, offloading work to other nodes is essential. Manually managing this process can be cumbersome. To encourage efficient offloading, we've streamlined the use of our queue system, making it as user-friendly as possible.

Appropriate use cases

One might wonder when and why to utilize a queue. Well, certain tasks can simply be deferred for later execution. An obvious and frequently encountered example is the generation of PDF documents, which is a computationally intensive task that doesn't necessarily need to be performed immediately. The timeliness of having the PDF ready is not critical enough to keep the user waiting.

Instead, we create a custom function responsible for generating the PDF and notifying the user via email. If we were to request the PDF generation within the same workflow, it would cause the user to experience delays. Therefore, we aim to decouple the PDF generation from the main workflow, and this is precisely where a queue item becomes essential.

How to utilize

The queue block is designed to execute as efficiently as possible. You provide it with the function you wish to execute, and it will automatically run that function in the background. It may run on another node or thread, as the queue's purpose is to abstract away the specific execution location, aiming to execute as closely to the specified time as feasible.

You have various options at your disposal to customize the behavior of the queue block. Detailed descriptions of each input pin can be found in the block documentation.

Auto Postpone execution

Each license comes with a predefined limit for the maximum number of concurrent queue items that can be executed simultaneously. This limit serves a dual purpose: it allows you to build high-end systems with fast-running, high-performance functions, while also preventing the system from becoming overly congested with running queue items. When you create multiple queue items simultaneously, the system automatically adds a few seconds to the execution time of each item to facilitate a more even distribution of workload.

Monitoring and Analytics

When managing queue items, it's important to have insight into their execution status and timing. You may wish to ascertain whether they have executed and when these executions occurred. Within the RUAL Studio interface, you can access the Queue option in the left-side menu. Navigating to this page will provide you with a comprehensive list of currently executing, scheduled, and completed queue items.

The data displayed on this page is quasi-real-time. As queue items progress through their lifecycle, you will observe them transitioning between tables, though there may be a slight delay of a few seconds. The data is retrieved directly from our backend, but it is not updated in real-time to ensure optimal system performance.