<?xml version='1.0' encoding='UTF-8' standalone='no'?>
<section xmlns="http://docbook.org/ns/docbook" version="5.0" xmlns:xlink="http://www.w3.org/1999/xlink" xml:id="_md__g_1_2ids_2dragonfly_2docs_2core_2process_queue" xml:lang="en-US">
<title>processQueue</title>
<indexterm><primary>processQueue</primary></indexterm>
<section xml:id="_md__g_1_2ids_2dragonfly_2docs_2core_2process_queue_1autotoc_md119">
<title>autotoc_md119</title>
<para>title: ArmaDragonflyClient - Process Queue icon: mdi:file-text-outline </para>
</section>
<section xml:id="_md__g_1_2ids_2dragonfly_2docs_2core_2process_queue_1autotoc_md120">
<title>excerpt: Processes a queue of tasks to be executed.</title></section>
<section xml:id="_md__g_1_2ids_2dragonfly_2docs_2core_2process_queue_1autotoc_md121">
<title>dragonfly_db_fnc_processQueue</title><section xml:id="_md__g_1_2ids_2dragonfly_2docs_2core_2process_queue_1autotoc_md122">
<title>Description</title>
<para>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.</para>
</section>
<section xml:id="_md__g_1_2ids_2dragonfly_2docs_2core_2process_queue_1autotoc_md123">
<title>Syntax</title>
<para><literallayout><computeroutput>[]&#32;spawn&#32;dragonfly_db_fnc_processQueue
</computeroutput></literallayout></para>
</section>
<section xml:id="_md__g_1_2ids_2dragonfly_2docs_2core_2process_queue_1autotoc_md124">
<title>Parameters</title>
<para>None. This function does not require any parameters.</para>
</section>
<section xml:id="_md__g_1_2ids_2dragonfly_2docs_2core_2process_queue_1autotoc_md125">
<title>Return Value</title>
<para>None. The function processes tasks in the queue and updates the processing state.</para>
</section>
<section xml:id="_md__g_1_2ids_2dragonfly_2docs_2core_2process_queue_1autotoc_md126">
<title>Examples</title><section xml:id="_md__g_1_2ids_2dragonfly_2docs_2core_2process_queue_1autotoc_md127">
<title>Start processing the queue manually:</title>
<para><literallayout><computeroutput>[]&#32;spawn&#32;dragonfly_db_fnc_processQueue;
</computeroutput></literallayout></para>
</section>
<section xml:id="_md__g_1_2ids_2dragonfly_2docs_2core_2process_queue_1autotoc_md128">
<title>Trigger queue processing from a client:</title>
<para><literallayout><computeroutput>[]&#32;remoteExec&#32;[&quot;dragonfly_db_fnc_processQueue&quot;,&#32;2,&#32;false];
</computeroutput></literallayout></para>
</section>
</section>
<section xml:id="_md__g_1_2ids_2dragonfly_2docs_2core_2process_queue_1autotoc_md129">
<title>Notes</title>
<para><itemizedlist>
<listitem>
<para>Sets <computeroutput>GVAR(isProcessing)</computeroutput> to true while running and false when complete</para>
</listitem><listitem>
<para>Processes one task per second to prevent overloading</para>
</listitem><listitem>
<para>Handles a wide range of database operations including:<itemizedlist>
<listitem>
<para>Key-value operations (get, set, delete)</para>
</listitem><listitem>
<para>Hash table operations (hget, hset, hgetall, etc.)</para>
</listitem><listitem>
<para>List operations (listadd, listrng, listset, etc.)</para>
</listitem></itemizedlist>
</para>
</listitem><listitem>
<para>Automatically started by <computeroutput>dragonfly_db_fnc_addTask</computeroutput> when new tasks are added</para>
</listitem><listitem>
<para>Each task execution is logged for debugging purposes</para>
</listitem><listitem>
<para>Should typically be spawned rather than called to avoid blocking</para>
</listitem></itemizedlist>
</para>
</section>
<section xml:id="_md__g_1_2ids_2dragonfly_2docs_2core_2process_queue_1autotoc_md130">
<title>Related Functions</title>
<para><itemizedlist>
<listitem>
<para><computeroutput>dragonfly_db_fnc_addTask</computeroutput>: Adds tasks to the queue for processing</para>
</listitem><listitem>
<para><computeroutput>dragonfly_db_fnc_handler</computeroutput>: Handles data returned from database operations</para>
</listitem><listitem>
<para><computeroutput>dragonfly_db_fnc_scheduler</computeroutput>: Manages callback responses from the database</para>
</listitem></itemizedlist>
</para>
</section>
<section xml:id="_md__g_1_2ids_2dragonfly_2docs_2core_2process_queue_1autotoc_md131">
<title>Links</title>
<para><link linkend="_md__g_1_2ids_2dragonfly_2docs_2core_2add_task">Add Task</link> | <link linkend="_md__g_1_2ids_2dragonfly_2docs_2core_2handler">Handler</link> | <link linkend="_md__g_1_2ids_2dragonfly_2docs_2core_2init">Init</link> | <link linkend="_md__g_1_2ids_2dragonfly_2docs_2core_2print_addon_name">Print Addon Name</link> | <link linkend="_md__g_1_2ids_2dragonfly_2docs_2core_2process_queue">Process Queue</link> | <link linkend="_md__g_1_2ids_2dragonfly_2docs_2core_2scheduler">Scheduler</link> | <link linkend="_md__g_1_2ids_2dragonfly_2docs_2core_2test">Test</link> </para>
</section>
</section>
</section>
