<?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_docs_2core_2process_queue" xml:lang="en-US">
<title>processQueue</title>
<indexterm><primary>processQueue</primary></indexterm>
<section xml:id="_md_docs_2core_2process_queue_1autotoc_md133">
<title>autotoc_md133</title>
<para>title: ArmaRAMDb - Process Queue icon: mdi:file-text-outline </para>
</section>
<section xml:id="_md_docs_2core_2process_queue_1autotoc_md134">
<title>excerpt: Processes a queue of tasks to be executed.</title></section>
<section xml:id="_md_docs_2core_2process_queue_1autotoc_md135">
<title>ramdb_db_fnc_processQueue</title><section xml:id="_md_docs_2core_2process_queue_1autotoc_md136">
<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_docs_2core_2process_queue_1autotoc_md137">
<title>Syntax</title>
<para><literallayout><computeroutput>[]&#32;spawn&#32;ramdb_db_fnc_processQueue
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2core_2process_queue_1autotoc_md138">
<title>Parameters</title>
<para>None. This function does not require any parameters.</para>
</section>
<section xml:id="_md_docs_2core_2process_queue_1autotoc_md139">
<title>Return Value</title>
<para>None. The function processes tasks in the queue and updates the processing state.</para>
</section>
<section xml:id="_md_docs_2core_2process_queue_1autotoc_md140">
<title>Examples</title><section xml:id="_md_docs_2core_2process_queue_1autotoc_md141">
<title>Start processing the queue manually:</title>
<para><literallayout><computeroutput>[]&#32;spawn&#32;ramdb_db_fnc_processQueue;
</computeroutput></literallayout></para>
</section>
<section xml:id="_md_docs_2core_2process_queue_1autotoc_md142">
<title>Trigger queue processing from a client:</title>
<para><literallayout><computeroutput>[]&#32;remoteExec&#32;[&quot;ramdb_db_fnc_processQueue&quot;,&#32;2,&#32;false];
</computeroutput></literallayout></para>
</section>
</section>
<section xml:id="_md_docs_2core_2process_queue_1autotoc_md143">
<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>ramdb_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_docs_2core_2process_queue_1autotoc_md144">
<title>Related Functions</title>
<para><itemizedlist>
<listitem>
<para><computeroutput>ramdb_db_fnc_addTask</computeroutput>: Adds tasks to the queue for processing</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_handler</computeroutput>: Handles data returned from database operations</para>
</listitem><listitem>
<para><computeroutput>ramdb_db_fnc_scheduler</computeroutput>: Manages callback responses from the database</para>
</listitem></itemizedlist>
</para>
</section>
<section xml:id="_md_docs_2core_2process_queue_1autotoc_md145">
<title>Links</title>
<para><link linkend="_md_docs_2core_2add_task">Add Task</link> | <link linkend="_md_docs_2core_2handler">Handler</link> | <link linkend="_md_docs_2core_2init">Init</link> | <link linkend="_md_docs_2core_2print_addon_name">Print Addon Name</link> | <link linkend="_md_docs_2core_2process_queue">Process Queue</link> | <link linkend="_md_docs_2core_2scheduler">Scheduler</link> | <link linkend="_md_docs_2core_2test">Test</link> </para>
</section>
</section>
</section>
