"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[5040],{3209:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>i,contentTitle:()=>o,default:()=>d,frontMatter:()=>a,metadata:()=>s,toc:()=>l});const s=JSON.parse('{"id":"XXTLanControl.lua/kvdb/queue/push_back","title":"Push To Queue Back (LCC.kvdb.queue.push_back)","description":"Signature","source":"@site/i18n/en/docusaurus-plugin-content-docs/current/XXTLanControl.lua/kvdb/queue/push_back.md","sourceDirName":"XXTLanControl.lua/kvdb/queue","slug":"/XXTLanControl.lua/kvdb/queue/push_back","permalink":"/docs/en/XXTLanControl.lua/kvdb/queue/push_back","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":30,"frontMatter":{"sidebar_position":30},"sidebar":"tutorialSidebar","previous":{"title":"Push To Queue Front (LCC.kvdb.queue.push_front)","permalink":"/docs/en/XXTLanControl.lua/kvdb/queue/push_front"},"next":{"title":"Pop From Queue Front (LCC.kvdb.queue.pop_front)","permalink":"/docs/en/XXTLanControl.lua/kvdb/queue/pop_front"}}');var t=r(4848),u=r(8453);const a={sidebar_position:30},o="Push To Queue Back (LCC.kvdb.queue.push_back)",i={},l=[{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 c(e){const n={blockquote:"blockquote",br:"br",code:"code",h1:"h1",h2:"h2",header:"header",li:"li",p:"p",pre:"pre",ul:"ul",...(0,u.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"push-to-queue-back-lcckvdbqueuepush_back",children:"Push To Queue Back (LCC.kvdb.queue.push_back)"})}),"\n",(0,t.jsx)(n.h2,{id:"signature",children:"Signature"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:"size, err = LCC.kvdb.queue.push_back(name, value, timeout?)\n"})}),"\n",(0,t.jsx)(n.h2,{id:"parameters",children:"Parameters"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["name",(0,t.jsx)(n.br,{}),"\n","String. Queue name (non-empty, max ",(0,t.jsx)(n.code,{children:"256"})," bytes)."]}),"\n",(0,t.jsxs)(n.li,{children:["value",(0,t.jsx)(n.br,{}),"\n","String, or a continuous string array. Strings must be valid UTF-8."]}),"\n",(0,t.jsxs)(n.li,{children:["timeout",(0,t.jsx)(n.br,{}),"\n","Number, optional. Request timeout in seconds, default ",(0,t.jsx)(n.code,{children:"60"}),"."]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"returns",children:"Returns"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["size",(0,t.jsx)(n.br,{}),"\n","Number. Queue length after the push; ",(0,t.jsx)(n.code,{children:"nil"})," on failure."]}),"\n",(0,t.jsxs)(n.li,{children:["err",(0,t.jsx)(n.br,{}),"\n","String or ",(0,t.jsx)(n.code,{children:"nil"}),". Error description when the call fails."]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"notes",children:"Notes"}),"\n",(0,t.jsxs)(n.blockquote,{children:["\n",(0,t.jsxs)(n.p,{children:["Pushes an item onto the tail of the queue.",(0,t.jsx)(n.br,{}),"\n","Batch pushes preserve array order. For example, ",(0,t.jsx)(n.code,{children:'{"a", "b"}'})," becomes the new tail ",(0,t.jsx)(n.code,{children:"..., a, b"}),".\nShares the same constraints as ",(0,t.jsx)(n.code,{children:"push_front"}),"."]}),"\n"]}),"\n",(0,t.jsx)(n.h2,{id:"example",children:"Example"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-lua",children:'local size, err = LCC.kvdb.queue.push_back("pending", "task#2")\nif not size then\n    error(err)\nend\n\nlocal batch_size, batch_err = LCC.kvdb.queue.push_back("pending", {"task#3", "task#4"})\n'})})]})}function d(e={}){const{wrapper:n}={...(0,u.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(c,{...e})}):c(e)}},8453:(e,n,r)=>{r.d(n,{R:()=>a,x:()=>o});var s=r(6540);const t={},u=s.createContext(t);function a(e){const n=s.useContext(u);return s.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function o(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(t):e.components||t:a(e.components),s.createElement(u.Provider,{value:n},e.children)}}}]);