"use strict";(self.webpackChunkdocs_site=self.webpackChunkdocs_site||[]).push([[4619],{8440:(e,n,r)=>{r.r(n),r.d(n,{assets:()=>a,contentTitle:()=>u,default:()=>c,frontMatter:()=>o,metadata:()=>t,toc:()=>i});const t=JSON.parse('{"id":"XXTLanControl.lua/kvdb/queue/pop_values","title":"Remove Items By Value (LCC.kvdb.queue.pop_values)","description":"Signature","source":"@site/i18n/en/docusaurus-plugin-content-docs/current/XXTLanControl.lua/kvdb/queue/pop_values.md","sourceDirName":"XXTLanControl.lua/kvdb/queue","slug":"/XXTLanControl.lua/kvdb/queue/pop_values","permalink":"/docs/en/XXTLanControl.lua/kvdb/queue/pop_values","draft":false,"unlisted":false,"tags":[],"version":"current","sidebarPosition":70,"frontMatter":{"sidebar_position":70},"sidebar":"tutorialSidebar","previous":{"title":"Atomically Move Queue Items (LCC.kvdb.queue.move)","permalink":"/docs/en/XXTLanControl.lua/kvdb/queue/move"},"next":{"title":"List Queue Contents (LCC.kvdb.queue.list)","permalink":"/docs/en/XXTLanControl.lua/kvdb/queue/list"}}');var s=r(4848),l=r(8453);const o={sidebar_position:70},u="Remove Items By Value (LCC.kvdb.queue.pop_values)",a={},i=[{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:"remove-items-by-value-lcckvdbqueuepop_values",children:"Remove Items By Value (LCC.kvdb.queue.pop_values)"})}),"\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:"count, err = LCC.kvdb.queue.pop_values(name, value, 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:["value",(0,s.jsx)(n.br,{}),"\n","String. Value to delete everywhere (must be valid UTF-8)."]}),"\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:["count",(0,s.jsx)(n.br,{}),"\n","Number. Number of removed items; ",(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:["Atomically removes every entry matching the given value.",(0,s.jsx)(n.br,{}),"\n","The return value reports how many items were removed."]}),"\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 removed, err = LCC.kvdb.queue.pop_values("pending", "timeout")\nif removed then\n    LCC.log(2, "Purged stale tasks", removed)\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,r)=>{r.d(n,{R:()=>o,x:()=>u});var t=r(6540);const s={},l=t.createContext(s);function o(e){const n=t.useContext(l);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function u(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),t.createElement(l.Provider,{value:n},e.children)}}}]);