"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[8320],{6744:(e,n,t)=>{t.r(n),t.d(n,{assets:()=>a,contentTitle:()=>i,default:()=>c,frontMatter:()=>u,metadata:()=>r,toc:()=>o});const r=JSON.parse('{"id":"XXTLanControl.lua/kvdb/queue/list","title":"List Queue Contents (LCC.kvdb.queue.list)","description":"Signature","source":"@site/i18n/en/docusaurus-plugin-content-docs/current/XXTLanControl.lua/kvdb/queue/list.md","sourceDirName":"XXTLanControl.lua/kvdb/queue","slug":"/XXTLanControl.lua/kvdb/queue/list","permalink":"/docs/en/XXTLanControl.lua/kvdb/queue/list","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":80,"frontMatter":{"sidebar_position":80},"sidebar":"tutorialSidebar","previous":{"title":"Remove Items By Value (LCC.kvdb.queue.pop_values)","permalink":"/docs/en/XXTLanControl.lua/kvdb/queue/pop_values"},"next":{"title":"Clear Entire Queue (LCC.kvdb.queue.clear)","permalink":"/docs/en/XXTLanControl.lua/kvdb/queue/clear"}}');var s=t(4848),l=t(8453);const u={sidebar_position:80},i="List Queue Contents (LCC.kvdb.queue.list)",a={},o=[{value:"Signature",id:"signature",level:2},{value:"Parameters",id:"parameters",level:2},{value:"Returns",id:"returns",level:2},{value:"Notes",id:"notes",level:2},{value:"Example",id:"example",level:2}];function d(e){const n={blockquote:"blockquote",br:"br",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,l.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(n.header,{children:(0,s.jsx)(n.h1,{id:"list-queue-contents-lcckvdbqueuelist",children:"List Queue Contents (LCC.kvdb.queue.list)"})}),"\n",(0,s.jsx)(n.h2,{id:"signature",children:"Signature"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-lua",children:"values, err = LCC.kvdb.queue.list(name, timeout?)\n"})}),"\n",(0,s.jsx)(n.h2,{id:"parameters",children:"Parameters"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["name",(0,s.jsx)(n.br,{}),"\n","String. Queue name (non-empty, max ",(0,s.jsx)(n.code,{children:"256"})," bytes)."]}),"\n",(0,s.jsxs)(n.li,{children:["timeout",(0,s.jsx)(n.br,{}),"\n","Number, optional. Request timeout in seconds, default ",(0,s.jsx)(n.code,{children:"60"}),"."]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"returns",children:"Returns"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["values",(0,s.jsx)(n.br,{}),"\n","Table. Array of strings in queue order; returns an empty array when the queue is empty, or ",(0,s.jsx)(n.code,{children:"nil"})," on failure."]}),"\n",(0,s.jsxs)(n.li,{children:["err",(0,s.jsx)(n.br,{}),"\n","String or ",(0,s.jsx)(n.code,{children:"nil"}),". Error description when the call fails."]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"notes",children:"Notes"}),"\n",(0,s.jsxs)(n.blockquote,{children:["\n",(0,s.jsxs)(n.p,{children:["Returns a snapshot of the entire queue.",(0,s.jsx)(n.br,{}),"\n","The array preserves order (index 1 equals the head of the queue).\nAn empty queue returns an empty array, not ",(0,s.jsx)(n.code,{children:"nil"}),"."]}),"\n"]}),"\n",(0,s.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-lua",children:'local values, err = LCC.kvdb.queue.list("pending")\nif values then\n    for i, v in ipairs(values) do\n        print(i, v)\n    end\nend\n'})})]})}function c(e={}){const{wrapper:n}={...(0,l.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(d,{...e})}):d(e)}},8453:(e,n,t)=>{t.d(n,{R:()=>u,x:()=>i});var r=t(6540);const s={},l=r.createContext(s);function u(e){const n=r.useContext(l);return r.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function i(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:u(e.components),r.createElement(l.Provider,{value:n},e.children)}}}]);