dragonfly/docs/core/processQueue.md
Jacob Schmidt c8d81ba3bb
All checks were successful
Build / Build (push) Successful in 39s
docs: Update README.md with detailed documentation
This commit significantly enhances the `README.md` file, providing comprehensive documentation for the ArmaDragonflyClient.

Key changes:

*   **Detailed Function Categories:** Categorized functions for better organization (Core, Basic Data Operations, Hash Operations, List Operations).
*   **Usage Examples:** Added clear and concise usage examples for basic operations, hash operations (context and ID-specific), and list operations.
*   **Function Documentation Structure:** Outlined the structure for individual function documentation.
*   **License Information:** Updated the license information.
2025-03-30 17:15:35 -05:00

58 lines
1.8 KiB
Markdown

---
title: ArmaDragonflyClient - Process Queue
icon: mdi:file-text-outline
excerpt: Processes a queue of tasks to be executed.
---
# dragonfly_db_fnc_processQueue
## Description
Processes the queue of pending database tasks sequentially. This function executes each task in the queue one by one, handling various database operations based on the task type. It continues processing until the queue is empty.
## Syntax
```sqf
[] spawn dragonfly_db_fnc_processQueue
```
## Parameters
None. This function does not require any parameters.
## Return Value
None. The function processes tasks in the queue and updates the processing state.
## Examples
### Start processing the queue manually:
```sqf
[] spawn dragonfly_db_fnc_processQueue;
```
### Trigger queue processing from a client:
```sqf
[] remoteExec ["dragonfly_db_fnc_processQueue", 2, false];
```
## Notes
- Sets `GVAR(isProcessing)` to true while running and false when complete
- Processes one task per second to prevent overloading
- Handles a wide range of database operations including:
- Key-value operations (get, set, delete)
- Hash table operations (hget, hset, hgetall, etc.)
- List operations (listadd, listrng, listset, etc.)
- Automatically started by `dragonfly_db_fnc_addTask` when new tasks are added
- Each task execution is logged for debugging purposes
- Should typically be spawned rather than called to avoid blocking
## Related Functions
- `dragonfly_db_fnc_addTask`: Adds tasks to the queue for processing
- `dragonfly_db_fnc_handler`: Handles data returned from database operations
- `dragonfly_db_fnc_scheduler`: Manages callback responses from the database
## Links
[Add Task](addTask.md) |
[Handler](handler.md) |
[Init](init.md) |
[Print Addon Name](printAddonName.md) |
[Process Queue](processQueue.md) |
[Scheduler](scheduler.md) |
[Test](test.md)