\chapter{add\+Task}
\hypertarget{md__g_1_2ids_2dragonfly_2docs_2core_2add_task}{}\label{md__g_1_2ids_2dragonfly_2docs_2core_2add_task}\index{addTask@{addTask}}
\hypertarget{md__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md67}{}\doxysubsection{\texorpdfstring{autotoc\+\_\+md67}{autotoc\+\_\+md67}}\label{md__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md67}
title\+: Arma\+Dragonfly\+Client -\/ Add Task icon\+: mdi\+:file-\/text-\/outline \hypertarget{md__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md68}{}\doxysubsection{\texorpdfstring{excerpt\+: Add task to queue.}{excerpt\+: Add task to queue.}}\label{md__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md68}
\hypertarget{md__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md69}{}\doxysection{\texorpdfstring{dragonfly\+\_\+db\+\_\+fnc\+\_\+add\+Task}{dragonfly\+\_\+db\+\_\+fnc\+\_\+add\+Task}}\label{md__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md69}
\hypertarget{md__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md70}{}\doxysubsection{\texorpdfstring{Description}{Description}}\label{md__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md70}
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__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md71}{}\doxysubsection{\texorpdfstring{Syntax}{Syntax}}\label{md__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md71}

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

\end{DoxyCode}
\hypertarget{md__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md72}{}\doxysubsection{\texorpdfstring{Parameters}{Parameters}}\label{md__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md72}
\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__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md73}{}\doxysubsection{\texorpdfstring{Return Value}{Return Value}}\label{md__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md73}
None. The task is added to the queue and processed asynchronously.\hypertarget{md__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md74}{}\doxysubsection{\texorpdfstring{Examples}{Examples}}\label{md__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md74}
\hypertarget{md__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md75}{}\doxysubsubsection{\texorpdfstring{Add a hash table retrieval task\+:}{Add a hash table retrieval task\+:}}\label{md__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md75}

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

\end{DoxyCode}
\hypertarget{md__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md76}{}\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__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md76}

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

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

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

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

\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__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md79}{}\doxysubsection{\texorpdfstring{Related Functions}{Related Functions}}\label{md__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md79}

\begin{DoxyItemize}
\item {\ttfamily dragonfly\+\_\+db\+\_\+fnc\+\_\+process\+Queue}\+: Processes the pending tasks in the queue
\item {\ttfamily dragonfly\+\_\+db\+\_\+fnc\+\_\+handler}\+: Handles the results of completed database operations
\item {\ttfamily dragonfly\+\_\+db\+\_\+fnc\+\_\+scheduler}\+: Manages callback responses from the database
\end{DoxyItemize}\hypertarget{md__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md80}{}\doxysubsection{\texorpdfstring{Links}{Links}}\label{md__g_1_2ids_2dragonfly_2docs_2core_2add_task_autotoc_md80}
\doxysectlink{md__g_1_2ids_2dragonfly_2docs_2core_2add_task}{Add Task}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md__g_1_2ids_2dragonfly_2docs_2core_2handler}{Handler}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md__g_1_2ids_2dragonfly_2docs_2core_2init}{Init}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md__g_1_2ids_2dragonfly_2docs_2core_2print_addon_name}{Print Addon Name}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md__g_1_2ids_2dragonfly_2docs_2core_2process_queue}{Process Queue}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md__g_1_2ids_2dragonfly_2docs_2core_2scheduler}{Scheduler}{0} \texorpdfstring{$\vert$}{|} \doxysectlink{md__g_1_2ids_2dragonfly_2docs_2core_2test}{Test}{0} 