FCF 2.0 development in progress...
> > > >
[News] [JS Packages API] [JS Downloads] [Donate to the project] [Contacts]

fcf.ActionsQueue class

Package: fcf-framework-core

File: fcf.js

Available from version: 2.0.16

A class for managing queues of asynchronous tasks and grouping them. It allows for coordinating the execution of multiple threads, ensuring synchronization between them and the ability to wait for entire groups of tasks to complete.

Detailed description

fcf.ActionsQueue is designed to organize complex asynchronous execution logic, where tasks need to be executed not simply one after another, but rather grouped into logical groups. This allows for synchronizing the execution of different code threads, waiting for all tasks within a specific group to complete before proceeding to the next steps.

Key Features:

  • Queue Management: Obtain an fcf.Actions object for sequentially adding tasks.
  • Task Grouping: Create named groups of asynchronous actions.
  • Group Synchronization: Wait for all tasks in a specific group to complete without blocking other groups.
  • Append Modes: Support for adding new tasks to an existing group (append mode) or creating a new group.

Methods
fcf.Actions getActions()
- The getActions method returns an fcf.Actions object that manages the current task queue. It ensures sequential execution of tasks by chaining new actions to the completion of all previously scheduled operations in the queue and automatically triggers the execution of accumulated completion callbacks.
fcf.Actions getAsyncActions()
- The getAsyncActions method allows grouping asynchronous tasks into named streams within a queue. It provides synchronization: the execution of the entire queue will be suspended until all tasks in the specified group have completed. The getAsyncActions method allows grouping asynchronous tasks into named streams within a queue. It provides synchronization: the execution of the entire queue will be suspended until all tasks in the specified group have completed.