"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[3949],{1723:(e,n,s)=>{s.r(n),s.d(n,{assets:()=>o,contentTitle:()=>c,default:()=>a,frontMatter:()=>u,metadata:()=>r,toc:()=>i});const r=JSON.parse('{"id":"XXTLanControl.lua/kvdb/queue/push_back","title":"\u961f\u5217\u5c3e\u90e8\u63a8\u5165 (LCC.kvdb.queue.push_back)","description":"\u58f0\u660e","source":"@site/docs/XXTLanControl.lua/kvdb/queue/push_back.md","sourceDirName":"XXTLanControl.lua/kvdb/queue","slug":"/XXTLanControl.lua/kvdb/queue/push_back","permalink":"/docs/XXTLanControl.lua/kvdb/queue/push_back","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":30,"frontMatter":{"sidebar_position":30},"sidebar":"tutorialSidebar","previous":{"title":"\u961f\u5217\u5934\u90e8\u63a8\u5165 (LCC.kvdb.queue.push_front)","permalink":"/docs/XXTLanControl.lua/kvdb/queue/push_front"},"next":{"title":"\u961f\u5217\u5934\u90e8\u5f39\u51fa (LCC.kvdb.queue.pop_front)","permalink":"/docs/XXTLanControl.lua/kvdb/queue/pop_front"}}');var l=s(4848),t=s(8453);const u={sidebar_position:30},c="\u961f\u5217\u5c3e\u90e8\u63a8\u5165 (LCC.kvdb.queue.push_back)",o={},i=[{value:"\u58f0\u660e",id:"\u58f0\u660e",level:2},{value:"\u53c2\u6570",id:"\u53c2\u6570",level:2},{value:"\u8fd4\u56de\u503c",id:"\u8fd4\u56de\u503c",level:2},{value:"\u8bf4\u660e",id:"\u8bf4\u660e",level:2},{value:"\u793a\u4f8b",id:"\u793a\u4f8b",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,t.R)(),...e.components};return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)(n.header,{children:(0,l.jsx)(n.h1,{id:"\u961f\u5217\u5c3e\u90e8\u63a8\u5165-lcckvdbqueuepush_back",children:"\u961f\u5217\u5c3e\u90e8\u63a8\u5165 (LCC.kvdb.queue.push_back)"})}),"\n",(0,l.jsx)(n.h2,{id:"\u58f0\u660e",children:"\u58f0\u660e"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-lua",children:"size, err = LCC.kvdb.queue.push_back(name, value, timeout?)\n"})}),"\n",(0,l.jsx)(n.h2,{id:"\u53c2\u6570",children:"\u53c2\u6570"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["name",(0,l.jsx)(n.br,{}),"\n","\u5b57\u7b26\u4e32\u578b\uff0c\u961f\u5217\u540d\u79f0\uff08\u975e\u7a7a\uff0c\u6700\u957f ",(0,l.jsx)(n.code,{children:"256"})," \u5b57\u8282\uff09"]}),"\n",(0,l.jsx)(n.li,{children:"value\n\u5b57\u7b26\u4e32\u578b\uff0c\u6216\u8fde\u7eed\u5b57\u7b26\u4e32\u6570\u7ec4\uff1b\u5b57\u7b26\u4e32\u5fc5\u987b\u4e3a\u5408\u6cd5 UTF-8"}),"\n",(0,l.jsxs)(n.li,{children:["timeout",(0,l.jsx)(n.br,{}),"\n","\u6570\u503c\u578b\uff0c\u53ef\u9009\uff1b\u8bf7\u6c42\u8d85\u65f6\u65f6\u95f4\uff08\u79d2\uff09\uff0c\u9ed8\u8ba4 ",(0,l.jsx)(n.code,{children:"60"})]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"\u8fd4\u56de\u503c",children:"\u8fd4\u56de\u503c"}),"\n",(0,l.jsxs)(n.ul,{children:["\n",(0,l.jsxs)(n.li,{children:["size",(0,l.jsx)(n.br,{}),"\n","\u6570\u503c\u578b\uff0c\u63a8\u5165\u540e\u961f\u5217\u7684\u5c3a\u5bf8\uff1b\u5931\u8d25\u65f6\u4e3a ",(0,l.jsx)(n.code,{children:"nil"})]}),"\n",(0,l.jsxs)(n.li,{children:["err",(0,l.jsx)(n.br,{}),"\n","\u5b57\u7b26\u4e32\u578b\u6216 ",(0,l.jsx)(n.code,{children:"nil"}),"\uff0c\u5931\u8d25\u65f6\u7684\u9519\u8bef\u63cf\u8ff0"]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"\u8bf4\u660e",children:"\u8bf4\u660e"}),"\n",(0,l.jsxs)(n.blockquote,{children:["\n",(0,l.jsxs)(n.p,{children:["\u5c06\u5143\u7d20\u538b\u5165\u961f\u5217\u5c3e\u90e8\u3002",(0,l.jsx)(n.br,{}),"\n","\u6279\u91cf\u63a8\u5165\u65f6\u4f1a\u4fdd\u6301\u6570\u7ec4\u987a\u5e8f\uff0c\u4f8b\u5982 ",(0,l.jsx)(n.code,{children:'{"a", "b"}'})," \u4f1a\u6210\u4e3a\u65b0\u7684\u961f\u5c3e ",(0,l.jsx)(n.code,{children:"..., a, b"}),"\u3002\n\u5176\u4f59\u7ea6\u675f\u4e0e ",(0,l.jsx)(n.code,{children:"push_front"})," \u4e00\u81f4\u3002"]}),"\n"]}),"\n",(0,l.jsx)(n.h2,{id:"\u793a\u4f8b",children:"\u793a\u4f8b"}),"\n",(0,l.jsx)(n.pre,{children:(0,l.jsx)(n.code,{className:"language-lua",children:'local size, err = LCC.kvdb.queue.push_back("\u5f85\u5904\u7406\u4efb\u52a1", "task#2")\nif not size then\n    error(err)\nend\n\nlocal batch_size, batch_err = LCC.kvdb.queue.push_back("\u5f85\u5904\u7406\u4efb\u52a1", {"task#3", "task#4"})\n'})})]})}function a(e={}){const{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,l.jsx)(n,{...e,children:(0,l.jsx)(d,{...e})}):d(e)}},8453:(e,n,s)=>{s.d(n,{R:()=>u,x:()=>c});var r=s(6540);const l={},t=r.createContext(l);function u(e){const n=r.useContext(t);return r.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(l):e.components||l:u(e.components),r.createElement(t.Provider,{value:n},e.children)}}}]);