\chapter{add\+Task}
\hypertarget{md_docs_2core_2add_task}{}\label{md_docs_2core_2add_task}\index{addTask@{addTask}}
\hypertarget{md_docs_2core_2add_task_autotoc_md81}{}\doxysubsection{\texorpdfstring{autotoc\+\_\+md81}{autotoc\+\_\+md81}}\label{md_docs_2core_2add_task_autotoc_md81}
title\+: Arma\+RAMDb -\/ Add Task icon\+: mdi\+:file-\/text-\/outline \hypertarget{md_docs_2core_2add_task_autotoc_md82}{}\doxysubsection{\texorpdfstring{excerpt\+: Add task to queue.}{excerpt\+: Add task to queue.}}\label{md_docs_2core_2add_task_autotoc_md82}
\hypertarget{md_docs_2core_2add_task_autotoc_md83}{}\doxysection{\texorpdfstring{ramdb\+\_\+db\+\_\+fnc\+\_\+add\+Task}{ramdb\+\_\+db\+\_\+fnc\+\_\+add\+Task}}\label{md_docs_2core_2add_task_autotoc_md83}
\hypertarget{md_docs_2core_2add_task_autotoc_md84}{}\doxysubsection{\texorpdfstring{Description}{Description}}\label{md_docs_2core_2add_task_autotoc_md84}
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.\hypertarget{md_docs_2core_2add_task_autotoc_md85}{}\doxysubsection{\texorpdfstring{Syntax}{Syntax}}\label{md_docs_2core_2add_task_autotoc_md85}

\begin{DoxyCode}{0}
\DoxyCodeLine{[\_taskType,\ \_key,\ \_keyField,\ \_index,\ \_value,\ \_function,\ \_call,\ \_netId]\ call\ ramdb\_db\_fnc\_addTask}

\end{DoxyCode}
\hypertarget{md_docs_2core_2add_task_autotoc_md86}{}\doxysubsection{\texorpdfstring{Parameters}{Parameters}}\label{md_docs_2core_2add_task_autotoc_md86}
\tabulinesep=1mm
\begin{longtabu}spread 0pt [c]{*{4}{|X[-1]}|}
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Parameter   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Type   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Description   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Default    }\\\cline{1-4}
\endfirsthead
\hline
\endfoot
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Parameter   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Type   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Description   }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Default    }\\\cline{1-4}
\endhead
{\ttfamily \+\_\+task\+Type}   &String   &Type of operation to perform (e.\+g., "{}hgetall"{})   &"{}"{}    \\\cline{1-4}
{\ttfamily \+\_\+key}   &String   &Name of the stored key   &"{}"{}    \\\cline{1-4}
{\ttfamily \+\_\+key\+Field}   &String   &Field name for hash operations   &"{}"{}    \\\cline{1-4}
{\ttfamily \+\_\+index}   &Number   &Index for list operations   &-\/1    \\\cline{1-4}
{\ttfamily \+\_\+value}   &Array, String, Number, or Boolean   &Value to store (for set operations)   &\mbox{[}\mbox{]}    \\\cline{1-4}
{\ttfamily \+\_\+function}   &String   &Name of function to call with the result   &"{}"{}    \\\cline{1-4}
{\ttfamily \+\_\+call}   &Boolean   &Whether to call the function directly (true) or spawn (false)   &false    \\\cline{1-4}
{\ttfamily \+\_\+net\+Id}   &String   &Net\+ID of the target to receive the result   &"{}"{}   \\\cline{1-4}
\end{longtabu}
\hypertarget{md_docs_2core_2add_task_autotoc_md87}{}\doxysubsection{\texorpdfstring{Return Value}{Return Value}}\label{md_docs_2core_2add_task_autotoc_md87}
None. The task is added to the queue and processed asynchronously.\hypertarget{md_docs_2core_2add_task_autotoc_md88}{}\doxysubsection{\texorpdfstring{Examples}{Examples}}\label{md_docs_2core_2add_task_autotoc_md88}
\hypertarget{md_docs_2core_2add_task_autotoc_md89}{}\doxysubsubsection{\texorpdfstring{Add a hash table retrieval task\+:}{Add a hash table retrieval task\+:}}\label{md_docs_2core_2add_task_autotoc_md89}

\begin{DoxyCode}{0}
\DoxyCodeLine{["{}hgetall"{},\ "{}"{},\ "{}"{},\ -\/1,\ [],\ "{}ramdb\_db\_fnc\_test"{}]\ call\ ramdb\_db\_fnc\_addTask;}

\end{DoxyCode}
\hypertarget{md_docs_2core_2add_task_autotoc_md90}{}\doxysubsubsection{\texorpdfstring{Add a player-\/specific task that returns data to a specific client\+:}{Add a player-\/specific task that returns data to a specific client\+:}}\label{md_docs_2core_2add_task_autotoc_md90}

\begin{DoxyCode}{0}
\DoxyCodeLine{["{}hgetallid"{},\ getPlayerUID\ player,\ "{}"{},\ -\/1,\ [],\ "{}ramdb\_db\_fnc\_test"{},\ false,\ netId\ player]\ remoteExecCall\ ["{}ramdb\_db\_fnc\_addTask"{},\ 2,\ false];}

\end{DoxyCode}
\hypertarget{md_docs_2core_2add_task_autotoc_md91}{}\doxysubsubsection{\texorpdfstring{Add a list operation task\+:}{Add a list operation task\+:}}\label{md_docs_2core_2add_task_autotoc_md91}

\begin{DoxyCode}{0}
\DoxyCodeLine{["{}listadd"{},\ "{}playerMessages"{},\ "{}"{},\ -\/1,\ ["{}New\ message\ content"{}],\ "{}"{}]\ call\ ramdb\_db\_fnc\_addTask;}

\end{DoxyCode}
\hypertarget{md_docs_2core_2add_task_autotoc_md92}{}\doxysubsection{\texorpdfstring{Notes}{Notes}}\label{md_docs_2core_2add_task_autotoc_md92}

\begin{DoxyItemize}
\item Tasks are processed in the order they are added to the queue
\item If the queue is not currently being processed, this function will start the processing
\item The task type determines which database operation will be performed
\item This function is particularly useful for scheduling multiple related operations
\item All operations performed through the task queue are logged for debugging
\end{DoxyItemize}\hypertarget{md_docs_2core_2add_task_autotoc_md93}{}\doxysubsection{\texorpdfstring{Related Functions}{Related Functions}}\label{md_docs_2core_2add_task_autotoc_md93}

\begin{DoxyItemize}
\item {\ttfamily ramdb\+\_\+db\+\_\+fnc\+\_\+process\+Queue}\+: Processes the pending tasks in the queue
\item {\ttfamily ramdb\+\_\+db\+\_\+fnc\+\_\+handler}\+: Handles the results of completed database operations
\item {\ttfamily ramdb\+\_\+db\+\_\+fnc\+\_\+scheduler}\+: Manages callback responses from the database
\end{DoxyItemize}\hypertarget{md_docs_2core_2add_task_autotoc_md94}{}\doxysubsection{\texorpdfstring{Links}{Links}}\label{md_docs_2core_2add_task_autotoc_md94}
\doxysectlink{md_docs_2core_2add_task}{Add Task}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2core_2handler}{Handler}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2core_2init}{Init}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2core_2print_addon_name}{Print Addon Name}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2core_2process_queue}{Process Queue}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2core_2scheduler}{Scheduler}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md_docs_2core_2test}{Test}{0} 