Dynamic Queues
This module allows you to create dynamic queues with uniquely configured names and set capacities for the number of items each queue can hold.
When the queues are emptied through a cron job or other methods, the system resets the queue count to zero, making it ready for the next data loads.
BENEFITS
1) Configurable Dynamic Queues (Maximum Queue limit)
This module enables site administrators to set a limit on the maximum number of items that a single queue can accommodate, thereby preventing the accumulation of large volumes of data within a single queue.
2) Dynamic Queue names
The site administrators possess the ability to use this configuration to integrate unique queue names, which the system can subsequently utilize for data loading activities.
REQUIREMENTS
Drupal 8.x, 9.x, 10.x
CONFIGURATION
- Navigate to /admin/dynamic-queues/config.
- Set the Maximum Queue Limit (e.g., 10).
- Provide distinct queue names that the system can utilize to read and create the queue with the specified item limits. (e.g. content_queue|newsletter|announcements|meeting_invitations).
Example Configuration -
For a content_queue with a limit of 10:
- If total data count is 20, it will manage as follows:
- dynamic_queues:content_queue_queue_0 holds 10 items.
- dynamic_queues:content_queue_queue_1 holds another 10 items.
Usage Instructions
a) Obtain and activate the dynamic queue module.
b) Set the necessary maximum queue limit and establish dynamic queue names.
c) Use the following code to load items into queues
\Drupal\dynamic_queues\Controller\DynamicQueueController::loadDatatoDynamicQueues('param1', 'param2');
Where
- 'param1' - Dynamic queue name, ex: content_queue
- 'param2' - Queue Data, ex: $queue_data
Example Loop
foreach ($data as $item) {
\Drupal\dynamic_queues\Controller\DynamicQueueController::loadDatatoDynamicQueues('content_queue', $item);
}
To Validate
a)Access the console and execute the command "drush queue-list" or "drush queue:list" to verify the dynamic queue names along with their respective items.
Depends on
Dependencies of the latest stable release
No dependencies recorded for this project.
Required by
Tracked projects that depend on this one
No tracked projects depend on this one yet.