ramdb/docs/core/addTask.md
Jacob Schmidt 8c0e8144e5 docs: Update documentation links and function references
This commit updates the documentation to reflect the current function names and link structure. Specifically, it addresses the following:

*   Corrected internal links within the documentation to point to the correct markdown files (e.g., `hashDelete.md` instead of `hashDelete`).
*   Updated related function references to reflect the current function names and include missing functions.
*   Removed outdated function references.
*   Added `ramdb_db_fnc_scheduler` to related functions where appropriate.
*   Updated the links section to use the correct markdown file names.
2025-03-22 16:53:30 -05:00

3.0 KiB

title, icon, excerpt
title icon excerpt
ArmaRAMDb - Add Task mdi:file-text-outline Add task to queue.

ramdb_db_fnc_addTask

Description

Adds a task to the database operation queue. This function is used to schedule database operations that can be processed sequentially, providing a way to manage multiple database requests in an organized manner.

Syntax

[_taskType, _key, _keyField, _index, _value, _function, _call, _netId] call ramdb_db_fnc_addTask

Parameters

Parameter Type Description Default
_taskType String Type of operation to perform (e.g., "hgetall") ""
_key String Name of the stored key ""
_keyField String Field name for hash operations ""
_index Number Index for list operations -1
_value Array, String, Number, or Boolean Value to store (for set operations) []
_function String Name of function to call with the result ""
_call Boolean Whether to call the function directly (true) or spawn (false) false
_netId String NetID of the target to receive the result ""

Return Value

None. The task is added to the queue and processed asynchronously.

Examples

Add a hash table retrieval task:

["hgetall", "", "", -1, [], "ramdb_db_fnc_test"] call ramdb_db_fnc_addTask;

Add a player-specific task that returns data to a specific client:

["hgetallid", getPlayerUID player, "", -1, [], "ramdb_db_fnc_test", false, netId player] remoteExecCall ["ramdb_db_fnc_addTask", 2, false];

Add a list operation task:

["listadd", "playerMessages", "", -1, ["New message content"], ""] call ramdb_db_fnc_addTask;

Notes

  • Tasks are processed in the order they are added to the queue
  • If the queue is not currently being processed, this function will start the processing
  • The task type determines which database operation will be performed
  • This function is particularly useful for scheduling multiple related operations
  • All operations performed through the task queue are logged for debugging
  • ramdb_db_fnc_processQueue: Processes the pending tasks in the queue
  • ramdb_db_fnc_handler: Handles the results of completed database operations
  • ramdb_db_fnc_scheduler: Manages callback responses from the database

Add Task | Handler | Init | Print Addon Name | Process Queue | Scheduler | Test