ramdb/api/latex/d8/d05/md_docs_2basic_2fetch.tex
Jacob Schmidt ee1dd91b7f
All checks were successful
Build / Build (push) Successful in 40s
feat: Add documentation for fetch function
This commit adds documentation for the `ramdb_db_fnc_fetch` function. The documentation explains the function's purpose, which is to handle data chunks received from the database extension when data is too large to be returned in a single callback. The documentation includes a title, icon, and excerpt for better readability and understanding.
2025-03-30 17:16:31 -05:00

51 lines
4.6 KiB
TeX

\chapter{fetch}
\hypertarget{md_docs_2basic_2fetch}{}\label{md_docs_2basic_2fetch}\index{fetch@{fetch}}
\hypertarget{md_docs_2basic_2fetch_autotoc_md13}{}\doxysubsection{\texorpdfstring{autotoc\+\_\+md13}{autotoc\+\_\+md13}}\label{md_docs_2basic_2fetch_autotoc_md13}
title\+: Arma\+RAMDb -\/ Fetch icon\+: mdi\+:file-\/text-\/outline \hypertarget{md_docs_2basic_2fetch_autotoc_md14}{}\doxysubsection{\texorpdfstring{excerpt\+: Handles data chunks received from the database extension when data is too large to be returned in a single callback.}{excerpt\+: Handles data chunks received from the database extension when data is too large to be returned in a single callback.}}\label{md_docs_2basic_2fetch_autotoc_md14}
\hypertarget{md_docs_2basic_2fetch_autotoc_md15}{}\doxysection{\texorpdfstring{ramdb\+\_\+db\+\_\+fnc\+\_\+fetch}{ramdb\+\_\+db\+\_\+fnc\+\_\+fetch}}\label{md_docs_2basic_2fetch_autotoc_md15}
\hypertarget{md_docs_2basic_2fetch_autotoc_md16}{}\doxysubsection{\texorpdfstring{Description}{Description}}\label{md_docs_2basic_2fetch_autotoc_md16}
Handles data chunks received from the database extension when data is too large to be returned in a single callback. This function collects all chunks of data, reassembles them in the correct order, and then passes the complete data to the handler function.\hypertarget{md_docs_2basic_2fetch_autotoc_md17}{}\doxysubsection{\texorpdfstring{Syntax}{Syntax}}\label{md_docs_2basic_2fetch_autotoc_md17}
\begin{DoxyCode}{0}
\DoxyCodeLine{[\_uniqueID,\ \_function,\ \_index,\ \_total,\ \_datachunk,\ \_call,\ \_netId]\ call\ ramdb\_db\_fnc\_fetch}
\end{DoxyCode}
\hypertarget{md_docs_2basic_2fetch_autotoc_md18}{}\doxysubsection{\texorpdfstring{Parameters}{Parameters}}\label{md_docs_2basic_2fetch_autotoc_md18}
\tabulinesep=1mm
\begin{longtabu}spread 0pt [c]{*{3}{|X[-1]}|}
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Parameter }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Type }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Description }\\\cline{1-3}
\endfirsthead
\hline
\endfoot
\hline
\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Parameter }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Type }&\PBS\centering \cellcolor{\tableheadbgcolor}\textbf{ Description }\\\cline{1-3}
\endhead
{\ttfamily \+\_\+unique\+ID} &String &Unique identifier for this data fetch operation \\\cline{1-3}
{\ttfamily \+\_\+function} &String &Name of the function to call after data is assembled \\\cline{1-3}
{\ttfamily \+\_\+index} &Number &Current chunk index (0-\/based) \\\cline{1-3}
{\ttfamily \+\_\+total} &Number &Total number of chunks expected \\\cline{1-3}
{\ttfamily \+\_\+datachunk} &String &The chunk of data being received \\\cline{1-3}
{\ttfamily \+\_\+call} &Boolean &Whether to call the function directly (true) or spawn (false) \\\cline{1-3}
{\ttfamily \+\_\+net\+Id} &String &(Optional) Net\+ID of the player to whom the data belongs \\\cline{1-3}
\end{longtabu}
\hypertarget{md_docs_2basic_2fetch_autotoc_md19}{}\doxysubsection{\texorpdfstring{Return Value}{Return Value}}\label{md_docs_2basic_2fetch_autotoc_md19}
None. When all chunks are received, the function will\+:
\begin{DoxyEnumerate}
\item Assemble the complete data string
\item Parse it as a simple array
\item Call the specified handler function with the parsed data
\end{DoxyEnumerate}\hypertarget{md_docs_2basic_2fetch_autotoc_md20}{}\doxysubsection{\texorpdfstring{Examples}{Examples}}\label{md_docs_2basic_2fetch_autotoc_md20}
This function is typically not called directly but is triggered by the extension\textquotesingle{}s callback mechanism when large datasets are retrieved.\hypertarget{md_docs_2basic_2fetch_autotoc_md21}{}\doxysubsection{\texorpdfstring{Notes}{Notes}}\label{md_docs_2basic_2fetch_autotoc_md21}
\begin{DoxyItemize}
\item The function stores received chunks in the global array {\ttfamily ramdb\+\_\+db\+\_\+fetch\+\_\+array}
\item Chunks are sorted by their index to ensure correct assembly regardless of arrival order
\item After successful processing, the chunks for this unique\+ID are removed from the array
\item This function is essential for handling large datasets that exceed the callback buffer limit
\end{DoxyItemize}\hypertarget{md_docs_2basic_2fetch_autotoc_md22}{}\doxysubsection{\texorpdfstring{Related Functions}{Related Functions}}\label{md_docs_2basic_2fetch_autotoc_md22}
\begin{DoxyItemize}
\item {\ttfamily ramdb\+\_\+db\+\_\+fnc\+\_\+handler}\+: Receives the assembled data and routes it to the appropriate function
\item {\ttfamily ramdb\+\_\+db\+\_\+fnc\+\_\+scheduler}\+: Manages the callback queue and triggers data fetching
\end{DoxyItemize}