CINXE.COM
Cloudflare Queues - JavaScript APIs · Cloudflare Queues
<!doctype html> <html lang="en" dir="ltr" data-has-toc data-has-sidebar data-theme="dark" class="astro-bguv2lll"> <head> <base href="https://developers.cloudflare.com/queues/configuration/javascript-apis/"> <script type="module">const t=document.querySelectorAll("a");function c(e,n){zaraz.track(e,{href:n.href,hostname:n.hostname})}function i(){if(!(!t||t.length===0))for(const e of t){if(!e.href)continue;const n=new URL(e.href),o=new RegExp("^[^.]+?\\.cloudflare\\.com");n.hostname!=="developers.cloudflare.com"&&(n.hostname==="workers.cloudflare.com"&&n.pathname.startsWith("/playground#")?e.addEventListener("click",()=>{c("playground link click",e)}):o.test(n.hostname)?e.addEventListener("click",()=>{c("Cross Domain Click",e)}):e.addEventListener("click",()=>{c("external link click",e)}))}}i();</script> <script type="module" src="/_astro/Head.astro_astro_type_script_index_1_lang.BJ-FY6qB.js"></script> <script type="module" src="/_astro/Head.astro_astro_type_script_index_2_lang.Dfph1UEd.js"></script> <meta charset="utf-8"> <meta name="viewport" content="width=device-width, initial-scale=1"> <title>Cloudflare Queues - JavaScript APIs · Cloudflare Queues</title> <link rel="canonical" href="https://developers.cloudflare.com/queues/configuration/javascript-apis/"> <link rel="sitemap" href="/sitemap-index.xml"> <link rel="shortcut icon" href="/favicon.png" type="image/png"> <meta name="generator" content="Astro v4.16.12"> <meta name="generator" content="Starlight v0.29.2"> <meta property="og:type" content="article"> <meta property="og:url" content="https://developers.cloudflare.com/queues/configuration/javascript-apis/"> <meta property="og:locale" content="en"> <meta property="og:description" content="Cloudflare Queues is integrated with Cloudflare Workers. To send and receive messages, you must use a Worker."> <meta property="og:site_name" content="Cloudflare Docs"> <meta name="twitter:card" content="summary_large_image"> <meta name="description" content="Cloudflare Queues is integrated with Cloudflare Workers. To send and receive messages, you must use a Worker."> <meta name="image" content="https://developers.cloudflare.com/cf-twitter-card.png"> <meta name="og:image" content="https://developers.cloudflare.com/cf-twitter-card.png"> <meta name="twitter:image" content="https://developers.cloudflare.com/cf-twitter-card.png"> <meta property="og:title" content="Cloudflare Queues - JavaScript APIs · Cloudflare Queues"> <meta name="pcx_product" content="Queues"> <meta name="algolia_product_filter" content="Queues"> <meta name="pcx_content_group" content="Developer platform"> <meta name="pcx_content_type" content="configuration"> <meta name="algolia_content_type" content="configuration"> <script> window.StarlightThemeProvider = (() => { const storedTheme = typeof localStorage !== 'undefined' && localStorage.getItem('starlight-theme'); const theme = storedTheme || (window.matchMedia('(prefers-color-scheme: light)').matches ? 'light' : 'dark'); document.documentElement.dataset.theme = theme === 'light' ? 'light' : 'dark'; return { updatePickers(theme = storedTheme || 'auto') { document.querySelectorAll('starlight-theme-select').forEach((picker) => { const select = picker.querySelector('select'); if (select) select.value = theme; /** @type {HTMLTemplateElement | null} */ const tmpl = document.querySelector(`#theme-icons`); const newIcon = tmpl && tmpl.content.querySelector('.' + theme); if (newIcon) { const oldIcon = picker.querySelector('svg.label-icon'); if (oldIcon) { oldIcon.replaceChildren(...newIcon.cloneNode(true).childNodes); } } }); }, }; })(); </script> <template id="theme-icons"> <svg aria-hidden="true" class="light astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"> <path d="M5 12a1 1 0 0 0-1-1H3a1 1 0 0 0 0 2h1a1 1 0 0 0 1-1Zm.64 5-.71.71a1 1 0 0 0 0 1.41 1 1 0 0 0 1.41 0l.71-.71A1 1 0 0 0 5.64 17ZM12 5a1 1 0 0 0 1-1V3a1 1 0 0 0-2 0v1a1 1 0 0 0 1 1Zm5.66 2.34a1 1 0 0 0 .7-.29l.71-.71a1 1 0 1 0-1.41-1.41l-.66.71a1 1 0 0 0 0 1.41 1 1 0 0 0 .66.29Zm-12-.29a1 1 0 0 0 1.41 0 1 1 0 0 0 0-1.41l-.71-.71a1.004 1.004 0 1 0-1.43 1.41l.73.71ZM21 11h-1a1 1 0 0 0 0 2h1a1 1 0 0 0 0-2Zm-2.64 6A1 1 0 0 0 17 18.36l.71.71a1 1 0 0 0 1.41 0 1 1 0 0 0 0-1.41l-.76-.66ZM12 6.5a5.5 5.5 0 1 0 5.5 5.5A5.51 5.51 0 0 0 12 6.5Zm0 9a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7Zm0 3.5a1 1 0 0 0-1 1v1a1 1 0 0 0 2 0v-1a1 1 0 0 0-1-1Z" /> </svg> <svg aria-hidden="true" class="dark astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"> <path d="M21.64 13a1 1 0 0 0-1.05-.14 8.049 8.049 0 0 1-3.37.73 8.15 8.15 0 0 1-8.14-8.1 8.59 8.59 0 0 1 .25-2A1 1 0 0 0 8 2.36a10.14 10.14 0 1 0 14 11.69 1 1 0 0 0-.36-1.05Zm-9.5 6.69A8.14 8.14 0 0 1 7.08 5.22v.27a10.15 10.15 0 0 0 10.14 10.14 9.784 9.784 0 0 0 2.1-.22 8.11 8.11 0 0 1-7.18 4.32v-.04Z" /> </svg> <svg aria-hidden="true" class="auto astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"> <path d="M21 14h-1V7a3 3 0 0 0-3-3H7a3 3 0 0 0-3 3v7H3a1 1 0 0 0-1 1v2a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-2a1 1 0 0 0-1-1ZM6 7a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v7H6V7Zm14 10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-1h16v1Z" /> </svg> </template> <link rel="stylesheet" href="/_astro/props.DH3lyL-U.css"> <style>*,*:before,*:after{box-sizing:border-box}*{margin:0}html{color-scheme:dark;accent-color:var(--sl-color-accent)}html[data-theme=light]{color-scheme:light}body{font-family:var(--__sl-font);line-height:var(--sl-line-height);-webkit-font-smoothing:antialiased;color:var(--sl-color-text);background-color:var(--sl-color-bg)}input,button,textarea,select{font:inherit}p,h1,h2,h3,h4,h5,h6,code{overflow-wrap:anywhere}code{font-family:var(--__sl-font-mono)} :root{--astro-code-color-text: var(--sl-color-white);--astro-code-color-background: var(--sl-color-gray-6);--astro-code-token-constant: var(--sl-color-blue-high);--astro-code-token-string: var(--sl-color-green-high);--astro-code-token-comment: var(--sl-color-gray-2);--astro-code-token-keyword: var(--sl-color-purple-high);--astro-code-token-parameter: var(--sl-color-red-high);--astro-code-token-function: var(--sl-color-red-high);--astro-code-token-string-expression: var(--sl-color-green-high);--astro-code-token-punctuation: var(--sl-color-gray-2);--astro-code-token-link: var(--sl-color-blue-high)} .sr-only{position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0}.sl-hidden{display:none}.sl-flex{display:flex}.sl-block{display:block}@media (min-width: 50rem){.md\:sl-hidden{display:none}.md\:sl-flex{display:flex}.md\:sl-block{display:block}}@media (min-width: 72rem){.lg\:sl-hidden{display:none}.lg\:sl-flex{display:flex}.lg\:sl-block{display:block}}[data-theme=light] .light\:sl-hidden,[data-theme=dark] .dark\:sl-hidden{display:none}[dir=rtl] .rtl\:flip:not(:where([dir=rtl] [dir=ltr] *)){transform:scaleX(-1)} .sl-banner:where(.astro-laz2plt2){--__sl-banner-text: var(--sl-color-banner-text, var(--sl-color-text-invert));padding:var(--sl-nav-pad-y) var(--sl-nav-pad-x);background-color:var(--sl-color-banner-bg, var(--sl-color-bg-accent));color:var(--__sl-banner-text);line-height:var(--sl-line-height-headings);text-align:center;text-wrap:balance;box-shadow:var(--sl-shadow-sm)}.sl-banner:where(.astro-laz2plt2) a{color:var(--__sl-banner-text)} .content-panel:where(.astro-7nkwcw3z){padding:1.5rem var(--sl-content-pad-x)}.content-panel:where(.astro-7nkwcw3z)+.content-panel:where(.astro-7nkwcw3z){border-top:1px solid var(--sl-color-hairline)}.sl-container:where(.astro-7nkwcw3z){max-width:var(--sl-content-width)}.sl-container:where(.astro-7nkwcw3z)>*+*{margin-top:1.5rem}@media (min-width: 72rem){.sl-container:where(.astro-7nkwcw3z){margin-inline:var(--sl-content-margin-inline, auto)}} p:where(.astro-opzsrvew){border:1px solid var(--sl-color-orange);padding:.75em 1em;background-color:var(--sl-color-orange-low);color:var(--sl-color-orange-high);width:-moz-max-content;width:max-content;max-width:100%;align-items:center;gap:.75em;font-size:var(--sl-text-body-sm);line-height:var(--sl-line-height-headings)} #ot-sdk-btn:where(.astro-hwxmvrii).ot-sdk-show-settings{border:none!important;color:inherit!important;font-size:inherit!important;line-height:inherit!important;padding:inherit!important;font-family:var(--sl-font-family)!important}#ot-sdk-btn:where(.astro-hwxmvrii).ot-sdk-show-settings:hover{background-color:inherit!important} a:where(.astro-eez2twj6){gap:.5rem;align-items:center;text-decoration:none;color:var(--sl-color-gray-3)}a:where(.astro-eez2twj6):hover{color:var(--sl-color-white)} .bleed:where(.astro-fxeopwe4){box-shadow:0 0 0 100vmax #001c43!important;clip-path:inset(0 -100vmax)} .tippy-box[data-animation=fade][data-state=hidden]{opacity:0}[data-tippy-root]{max-width:calc(100vw - 10px)}.tippy-box{position:relative;background-color:#333;color:#fff;border-radius:4px;font-size:14px;line-height:1.4;white-space:normal;outline:0;transition-property:transform,visibility,opacity}.tippy-box[data-placement^=top]>.tippy-arrow{bottom:0}.tippy-box[data-placement^=top]>.tippy-arrow:before{bottom:-7px;left:0;border-width:8px 8px 0;border-top-color:initial;transform-origin:center top}.tippy-box[data-placement^=bottom]>.tippy-arrow{top:0}.tippy-box[data-placement^=bottom]>.tippy-arrow:before{top:-7px;left:0;border-width:0 8px 8px;border-bottom-color:initial;transform-origin:center bottom}.tippy-box[data-placement^=left]>.tippy-arrow{right:0}.tippy-box[data-placement^=left]>.tippy-arrow:before{border-width:8px 0 8px 8px;border-left-color:initial;right:-7px;transform-origin:center left}.tippy-box[data-placement^=right]>.tippy-arrow{left:0}.tippy-box[data-placement^=right]>.tippy-arrow:before{left:-7px;border-width:8px 8px 8px 0;border-right-color:initial;transform-origin:center right}.tippy-box[data-inertia][data-state=visible]{transition-timing-function:cubic-bezier(.54,1.5,.38,1.11)}.tippy-arrow{width:16px;height:16px;color:#333}.tippy-arrow:before{content:"";position:absolute;border-color:transparent;border-style:solid}.tippy-content{position:relative;padding:5px 9px;z-index:1} </style> <link rel="stylesheet" href="/_astro/markdown.BmaHg7Hb.css"> <style>.pagination-links:where(.astro-u2l5gyhi){display:grid;grid-template-columns:repeat(auto-fit,minmax(min(18rem,100%),1fr));gap:1rem}a:where(.astro-u2l5gyhi){display:flex;align-items:center;justify-content:flex-start;gap:.5rem;width:100%;flex-basis:calc(50% - .5rem);flex-grow:1;border:1px solid var(--sl-color-gray-5);border-radius:.5rem;padding:1rem;text-decoration:none;color:var(--sl-color-gray-2);box-shadow:var(--sl-shadow-md);overflow-wrap:anywhere}:where(.astro-u2l5gyhi)[rel=next]{justify-content:end;text-align:end;flex-direction:row-reverse}a:where(.astro-u2l5gyhi):hover{border-color:var(--sl-color-gray-2)}.link-title:where(.astro-u2l5gyhi){color:var(--sl-color-white);font-size:var(--sl-text-2xl);line-height:var(--sl-line-height-headings)}svg:where(.astro-u2l5gyhi){flex-shrink:0} </style> <link rel="stylesheet" href="/_astro/modal.CF_ijafl.css"> <style>:root{--docsearch-primary-color: var(--sl-color-text-accent);--docsearch-text-color: var(--sl-color-text);--docsearch-spacing: 12px;--docsearch-icon-stroke-width: 1.4;--docsearch-highlight-color: var(--docsearch-primary-color);--docsearch-muted-color: var(--sl-color-gray-3);--docsearch-container-background: var(--sl-color-backdrop-overlay);--docsearch-modal-width: 560px;--docsearch-modal-height: 600px;--docsearch-modal-background: var(--sl-color-gray-6);--docsearch-modal-shadow: var(--sl-shadow-lg);--docsearch-searchbox-height: 56px;--docsearch-searchbox-background: var(--sl-color-gray-7, var(--sl-color-gray-6));--docsearch-searchbox-focus-background: var(--sl-color-black);--docsearch-searchbox-shadow: inset 0 0 0 1px var(--docsearch-primary-color);--docsearch-hit-height: 56px;--docsearch-hit-color: var(--sl-color-white);--docsearch-hit-active-color: var(--sl-color-black);--docsearch-hit-background: var(--sl-color-black);--docsearch-key-gradient: linear-gradient( var(--sl-color-bg-inline-code) 0%, var(--sl-color-bg-inline-code) 100% );--docsearch-footer-height: 44px;--docsearch-footer-background: var(--sl-color-black);--docsearch-footer-shadow: 0 -1px 0 0 var(--sl-color-hairline-light)}.DocSearch-Modal{border:1px solid var(--sl-color-hairline-light)}.DocSearch-Logo svg *{fill:var(--docsearch-muted-color)} footer:where(.astro-3yyafb3n){flex-direction:column;gap:1.5rem}.meta:where(.astro-3yyafb3n){gap:.75rem 3rem;justify-content:space-between;flex-wrap:wrap;margin-top:3rem;font-size:var(--sl-text-sm);color:var(--sl-color-gray-3)}.meta:where(.astro-3yyafb3n)>p:only-child{margin-inline-start:auto}.kudos:where(.astro-3yyafb3n){align-items:center;gap:.5em;margin:1.5rem auto;font-size:var(--sl-text-xs);text-decoration:none;color:var(--sl-color-gray-3)}.kudos:where(.astro-3yyafb3n) svg{color:var(--sl-color-orange)}.kudos:where(.astro-3yyafb3n):hover{color:var(--sl-color-white)} .page:where(.astro-vrdttmbt){flex-direction:column;min-height:100vh}.header:where(.astro-vrdttmbt){z-index:var(--sl-z-index-navbar);position:fixed;inset-inline-start:0;inset-block-start:0;width:100%;height:var(--sl-nav-height);border-bottom:1px solid var(--sl-color-hairline-shade);padding:var(--sl-nav-pad-y) var(--sl-nav-pad-x);padding-inline-end:var(--sl-nav-pad-x);background-color:var(--sl-color-bg-nav)}[data-has-sidebar] .header:where(.astro-vrdttmbt){padding-inline-end:calc(var(--sl-nav-gap) + var(--sl-nav-pad-x) + var(--sl-menu-button-size))}.sidebar-pane:where(.astro-vrdttmbt){visibility:var(--sl-sidebar-visibility, hidden);position:fixed;z-index:var(--sl-z-index-menu);inset-block:var(--sl-nav-height) 0;inset-inline-start:0;width:100%;background-color:var(--sl-color-black);overflow-y:auto}[aria-expanded=true]~.sidebar-pane:where(.astro-vrdttmbt){--sl-sidebar-visibility: visible}.sidebar-content:where(.astro-vrdttmbt){height:100%;min-height:-moz-max-content;min-height:max-content;padding:1rem var(--sl-sidebar-pad-x) 0;flex-direction:column;gap:1rem}@media (min-width: 50rem){.sidebar-content:where(.astro-vrdttmbt):after{content:"";padding-bottom:1px}}.main-frame:where(.astro-vrdttmbt){padding-top:calc(var(--sl-nav-height) + var(--sl-mobile-toc-height));padding-inline-start:var(--sl-content-inline-start)}@media (min-width: 50rem){[data-has-sidebar] .header:where(.astro-vrdttmbt){padding-inline-end:var(--sl-nav-pad-x)}.sidebar-pane:where(.astro-vrdttmbt){--sl-sidebar-visibility: visible;width:var(--sl-sidebar-width);background-color:var(--sl-color-bg-sidebar);border-inline-end:1px solid var(--sl-color-hairline-shade)}} .DocSearch-Button{display:flex;align-items:center;gap:.5rem;border:0;background-color:transparent;color:var(--sl-color-gray-1);cursor:pointer;height:2.5rem;font-size:var(--sl-text-xl)}.DocSearch-Button-Container{display:contents}.DocSearch-Search-Icon{width:.875em;height:.875em;stroke-width:.125rem}.DocSearch-Button-Placeholder,.DocSearch-Button-Keys,.DocSearch-Button-Key{display:none}@media (min-width: 50rem){sl-doc-search{width:100%}.DocSearch-Button{border:1px solid var(--sl-color-gray-5);border-radius:.5rem;padding-inline-start:.75rem;padding-inline-end:1rem;background-color:var(--sl-color-black);color:var(--sl-color-gray-2);font-size:var(--sl-text-sm);width:100%;max-width:22rem}.DocSearch-Button:hover{border-color:var(--sl-color-gray-2);color:var(--sl-color-white)}.DocSearch-Button-Placeholder,.DocSearch-Button-Keys{display:flex}.DocSearch-Button-Keys{margin-inline-start:auto}.DocSearch-Button-Keys:before{content:"";width:1em;height:1em;-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 2H7a5 5 0 0 0-5 5v10a5 5 0 0 0 5 5h10a5 5 0 0 0 5-5V7a5 5 0 0 0-5-5Zm3 15a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v10Z'%3E%3C/path%3E%3Cpath d='M15.293 6.707a1 1 0 1 1 1.414 1.414l-8.485 8.486a1 1 0 0 1-1.414-1.415l8.485-8.485Z'%3E%3C/path%3E%3C/svg%3E");mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17 2H7a5 5 0 0 0-5 5v10a5 5 0 0 0 5 5h10a5 5 0 0 0 5-5V7a5 5 0 0 0-5-5Zm3 15a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v10Z'%3E%3C/path%3E%3Cpath d='M15.293 6.707a1 1 0 1 1 1.414 1.414l-8.485 8.486a1 1 0 0 1-1.414-1.415l8.485-8.485Z'%3E%3C/path%3E%3C/svg%3E");-webkit-mask-size:100%;mask-size:100%;background-color:currentColor}} [data-mobile-menu-expanded]{overflow:hidden}@media (min-width: 50rem){[data-mobile-menu-expanded]{overflow:auto}} .hero:where(.astro-jbfsktt5){display:grid;align-items:center;gap:1rem;padding-bottom:1rem}.hero:where(.astro-jbfsktt5)>img:where(.astro-jbfsktt5),.hero:where(.astro-jbfsktt5)>.hero-html:where(.astro-jbfsktt5){-o-object-fit:contain;object-fit:contain;width:min(70%,20rem);height:auto;margin-inline:auto}.stack:where(.astro-jbfsktt5){flex-direction:column;gap:clamp(1.5rem,calc(1.5rem + 1vw),2rem);text-align:center}.copy:where(.astro-jbfsktt5){flex-direction:column;gap:1rem;align-items:center}.copy:where(.astro-jbfsktt5)>:where(.astro-jbfsktt5){max-width:50ch}h1:where(.astro-jbfsktt5){font-size:clamp(var(--sl-text-3xl),calc(.25rem + 5vw),var(--sl-text-6xl));line-height:var(--sl-line-height-headings);font-weight:600;color:var(--sl-color-white)}.tagline:where(.astro-jbfsktt5){font-size:clamp(var(--sl-text-base),calc(.0625rem + 2vw),var(--sl-text-xl));color:var(--sl-color-gray-2)}.actions:where(.astro-jbfsktt5){gap:1rem 2rem;flex-wrap:wrap;justify-content:center}@media (min-width: 50rem){.hero:where(.astro-jbfsktt5){grid-template-columns:7fr 4fr;gap:3%;padding-block:clamp(2.5rem,calc(1rem + 10vmin),10rem)}.hero:where(.astro-jbfsktt5)>img:where(.astro-jbfsktt5),.hero:where(.astro-jbfsktt5)>.hero-html:where(.astro-jbfsktt5){order:2;width:min(100%,25rem)}.stack:where(.astro-jbfsktt5){text-align:start}.copy:where(.astro-jbfsktt5){align-items:flex-start}.actions:where(.astro-jbfsktt5){justify-content:flex-start}} dialog:where(.astro-vjux6bgf){background:transparent;border:0;height:100vh;height:100dvh;margin:0;max-height:none;max-width:none;overflow:hidden;padding:0;position:fixed;width:100vw;width:100dvw}dialog:where(.astro-vjux6bgf)::backdrop{background:var(--starlight-image-zoom-backdrop-bg, var(--sl-color-black));opacity:0}.starlight-image-zoom-opened dialog:where(.astro-vjux6bgf)::backdrop{opacity:1}figure:where(.astro-vjux6bgf){cursor:zoom-out;height:100%;position:relative;width:100%}figure:where(.astro-vjux6bgf) figcaption{background-color:color-mix(in srgb,var(--sl-color-bg-nav),transparent 10%);border-top:1px solid var(--sl-color-hairline);cursor:initial;inset:auto 0 0;opacity:0;padding:var(--sl-nav-pad-y) var(--sl-nav-pad-x);position:absolute}@media (prefers-reduced-transparency){figure:where(.astro-vjux6bgf) figcaption{background-color:var(--sl-color-bg-nav)}}.starlight-image-zoom-opened figure:where(.astro-vjux6bgf) figcaption{opacity:1}button:where(.astro-vjux6bgf){cursor:zoom-out;opacity:0;z-index:1}.starlight-image-zoom-opened button:where(.astro-vjux6bgf){opacity:1}@media (prefers-reduced-motion: no-preference){button:where(.astro-vjux6bgf),dialog:where(.astro-vjux6bgf)::backdrop,figure:where(.astro-vjux6bgf) figcaption{transition:opacity var(--starlight-image-zoom-animation-duration)}} html{.feedback-prompt-content{margin-top:1.5em!important;@media (min-width: 1152px){display:none}}&:not([data-has-toc]){.feedback-prompt-content{display:block}}&[data-has-hero]{.feedback-prompt-content{display:none}}}.sl-markdown-content:where(.astro-cedpceuv) .heading-wrapper{--icon-size: .75em;--icon-spacing: .25em;line-height:var(--sl-line-height-headings)}.sl-markdown-content:where(.astro-cedpceuv) :not(.heading-wrapper)+:is(.heading-wrapper):not(:where(.not-content *)){margin-top:1.5em}.sl-markdown-content:where(.astro-cedpceuv) .level-h2{font-size:var(--sl-text-h2)}.sl-markdown-content:where(.astro-cedpceuv) .level-h3{font-size:var(--sl-text-h3)}.sl-markdown-content:where(.astro-cedpceuv) .level-h4{font-size:var(--sl-text-h4)}.sl-markdown-content:where(.astro-cedpceuv) .level-h5{font-size:var(--sl-text-h5)}.sl-markdown-content:where(.astro-cedpceuv) .heading-wrapper>:first-child{margin-inline-end:calc(var(--icon-size) + var(--icon-spacing));display:inline}.sl-markdown-content:where(.astro-cedpceuv) .anchor-link{margin-inline-start:calc(-1 * (var(--icon-size)));color:var(--sl-color-gray-3)}.sl-markdown-content:where(.astro-cedpceuv) .anchor-link:hover,.sl-markdown-content:where(.astro-cedpceuv) .anchor-link:focus{color:var(--sl-color-text-accent)}.sl-markdown-content:where(.astro-cedpceuv) .heading-wrapper svg{display:inline;width:var(--icon-size)}.sl-markdown-content:where(.astro-cedpceuv) .anchor-link .sr-only{-webkit-user-select:none;-moz-user-select:none;user-select:none}@media (hover: hover){.sl-markdown-content:where(.astro-cedpceuv) .anchor-link{opacity:0}}.sl-markdown-content:where(.astro-cedpceuv) .heading-wrapper:hover>.anchor-link,.sl-markdown-content:where(.astro-cedpceuv) .anchor-link:focus{opacity:1}@media (min-width: 95em){.sl-markdown-content:where(.astro-cedpceuv) .heading-wrapper{display:flex;flex-direction:row-reverse;justify-content:flex-end;gap:var(--icon-spacing);margin-inline-start:calc(-1 * (var(--icon-size) + var(--icon-spacing)))}.sl-markdown-content:where(.astro-cedpceuv) .heading-wrapper>:first-child,.sl-markdown-content:where(.astro-cedpceuv) .anchor-link{margin:0}} button:where(.astro-jif73yzw){position:fixed;top:calc((var(--sl-nav-height) - var(--sl-menu-button-size)) / 2);inset-inline-end:var(--sl-nav-pad-x);z-index:var(--sl-z-index-navbar);border:0;border-radius:50%;width:var(--sl-menu-button-size);height:var(--sl-menu-button-size);padding:.5rem;background-color:var(--sl-color-white);color:var(--sl-color-black);box-shadow:var(--sl-shadow-md);cursor:pointer}:where(.astro-jif73yzw)[aria-expanded=true] button:where(.astro-jif73yzw){background-color:var(--sl-color-gray-2);box-shadow:none}[data-theme=light] button:where(.astro-jif73yzw){background-color:var(--sl-color-black);color:var(--sl-color-white)}[data-theme=light] :where(.astro-jif73yzw)[aria-expanded=true] button:where(.astro-jif73yzw){background-color:var(--sl-color-gray-5)} .site-title:where(.astro-m46x6ez3){align-items:center;gap:var(--sl-nav-gap);font-size:var(--sl-text-h4);font-weight:600;color:var(--sl-color-text-accent);text-decoration:none;white-space:nowrap}img:where(.astro-m46x6ez3){height:calc(var(--sl-nav-height) - 2 * var(--sl-nav-pad-y));width:auto;max-width:100%;-o-object-fit:contain;object-fit:contain;-o-object-position:0 50%;object-position:0 50%} :root{--sl-icon-color: var(--sl-color-text)} :root{--starlight-image-zoom-animation-duration: .3s}starlight-image-zoom-zoomable{display:inline-block;position:relative;width:100%}starlight-image-zoom-zoomable img{cursor:zoom-in}starlight-image-zoom-zoomable button{cursor:zoom-in}starlight-image-zoom-zoomable button:not(:focus):not(:focus-within){border:none;clip:rect(0,0,0,0);height:1px;margin:-1px;overflow:hidden;padding:0;white-space:nowrap;width:1px}.starlight-image-zoom-control{background-color:var(--sl-color-bg-nav);border:2px solid var(--sl-color-gray-2);border-radius:50%;display:grid;height:44px;inset:20px auto auto 20px;margin-top:0!important;padding:10px;place-items:center;position:absolute;width:44px}:is(.starlight-image-zoom-opened,.starlight-image-zoom-transition) .starlight-image-zoom-control{inset:20px 20px auto auto}.starlight-image-zoom-source{visibility:hidden}.starlight-image-zoom-image{cursor:zoom-out}@media (prefers-reduced-motion: no-preference){.starlight-image-zoom-image{transition:transform var(--starlight-image-zoom-animation-duration) cubic-bezier(.4,0,.2,1)}} .header:where(.astro-kmkmnagf){gap:var(--sl-nav-gap);justify-content:space-between;align-items:center;height:100%}.title-wrapper:where(.astro-kmkmnagf){overflow:hidden}.right-group:where(.astro-kmkmnagf),.social-icons:where(.astro-kmkmnagf){gap:1rem;align-items:center}.social-icons:where(.astro-kmkmnagf):after{content:"";height:2rem;border-inline-end:1px solid var(--sl-color-gray-5)}@media (min-width: 50rem){:root[data-has-sidebar]{--__sidebar-pad: calc(2 * var(--sl-nav-pad-x))}:root:not([data-has-toc]){--__toc-width: 0rem}.header:where(.astro-kmkmnagf){--__sidebar-width: max(0rem, var(--sl-content-inline-start, 0rem) - var(--sl-nav-pad-x));--__main-column-fr: calc( ( 100% + var(--__sidebar-pad, 0rem) - var(--__toc-width, var(--sl-sidebar-width)) - (2 * var(--__toc-width, var(--sl-nav-pad-x))) - var(--sl-content-inline-start, 0rem) - var(--sl-content-width) ) / 2 );display:grid;grid-template-columns:minmax(calc(var(--__sidebar-width) + max(0rem,var(--__main-column-fr) - var(--sl-nav-gap))),auto) 1fr auto;align-content:center}} :root{--sl-badge-default-border: var(--sl-color-accent);--sl-badge-default-bg: var(--sl-color-accent-low);--sl-badge-default-text: #fff;--sl-badge-note-border: var(--sl-color-blue);--sl-badge-note-bg: var(--sl-color-blue-low);--sl-badge-note-text: #fff;--sl-badge-danger-border: var(--sl-color-red);--sl-badge-danger-bg: var(--sl-color-red-low);--sl-badge-danger-text: #fff;--sl-badge-success-border: var(--sl-color-green);--sl-badge-success-bg: var(--sl-color-green-low);--sl-badge-success-text: #fff;--sl-badge-caution-border: var(--sl-color-orange);--sl-badge-caution-bg: var(--sl-color-orange-low);--sl-badge-caution-text: #fff;--sl-badge-tip-border: var(--sl-color-purple);--sl-badge-tip-bg: var(--sl-color-purple-low);--sl-badge-tip-text: #fff}[data-theme=light]:root{--sl-badge-default-bg: var(--sl-color-accent-high);--sl-badge-note-bg: var(--sl-color-blue-high);--sl-badge-danger-bg: var(--sl-color-red-high);--sl-badge-success-bg: var(--sl-color-green-high);--sl-badge-caution-bg: var(--sl-color-orange-high);--sl-badge-tip-bg: var(--sl-color-purple-high)}.sl-badge:where(.astro-avdet4wd){display:inline-block;border:1px solid var(--sl-color-border-badge);border-radius:.25rem;font-family:var(--sl-font-system-mono);line-height:normal;color:var(--sl-color-text-badge);background-color:var(--sl-color-bg-badge);overflow-wrap:anywhere}.sidebar-content .sl-badge:where(.astro-avdet4wd){line-height:1;font-size:var(--sl-text-xs);padding:.125rem .375rem}.sidebar-content a[aria-current=page]>.sl-badge:where(.astro-avdet4wd){--sl-color-bg-badge: transparent;--sl-color-border-badge: currentColor;color:inherit}.default:where(.astro-avdet4wd){--sl-color-bg-badge: var(--sl-badge-default-bg);--sl-color-border-badge: var(--sl-badge-default-border);--sl-color-text-badge: var(--sl-badge-default-text)}.note:where(.astro-avdet4wd){--sl-color-bg-badge: var(--sl-badge-note-bg);--sl-color-border-badge: var(--sl-badge-note-border);--sl-color-text-badge: var(--sl-badge-note-text)}.danger:where(.astro-avdet4wd){--sl-color-bg-badge: var(--sl-badge-danger-bg);--sl-color-border-badge: var(--sl-badge-danger-border);--sl-color-text-badge: var(--sl-badge-danger-text)}.success:where(.astro-avdet4wd){--sl-color-bg-badge: var(--sl-badge-success-bg);--sl-color-border-badge: var(--sl-badge-success-border);--sl-color-text-badge: var(--sl-badge-success-text)}.tip:where(.astro-avdet4wd){--sl-color-bg-badge: var(--sl-badge-tip-bg);--sl-color-border-badge: var(--sl-badge-tip-border);--sl-color-text-badge: var(--sl-badge-tip-text)}.caution:where(.astro-avdet4wd){--sl-color-bg-badge: var(--sl-badge-caution-bg);--sl-color-border-badge: var(--sl-badge-caution-border);--sl-color-text-badge: var(--sl-badge-caution-text)}.small:where(.astro-avdet4wd){font-size:var(--sl-text-xs);padding:.125rem .25rem}.medium:where(.astro-avdet4wd){font-size:var(--sl-text-sm);padding:.175rem .35rem}.large:where(.astro-avdet4wd){font-size:var(--sl-text-base);padding:.225rem .45rem}.sl-markdown-content :is(h1,h2,h3,h4,h5,h6) .sl-badge:where(.astro-avdet4wd){vertical-align:middle} .card-grid:where(.astro-zntqmydn){display:grid;grid-template-columns:100%;gap:1rem}.card-grid:where(.astro-zntqmydn)>*{margin-top:0!important}@media (min-width: 50rem){.card-grid:where(.astro-zntqmydn){grid-template-columns:1fr 1fr;gap:1.5rem}.stagger:where(.astro-zntqmydn){--stagger-height: 5rem;padding-bottom:var(--stagger-height)}.stagger:where(.astro-zntqmydn)>*:nth-child(2n){transform:translateY(var(--stagger-height))}} .card:where(.astro-v5tidmuc){--sl-card-border: var(--sl-color-purple);--sl-card-bg: var(--sl-color-purple-low);border:1px solid var(--sl-color-gray-5);background-color:var(--sl-color-black);padding:clamp(1rem,calc(.125rem + 3vw),2.5rem);flex-direction:column;gap:clamp(.5rem,calc(.125rem + 1vw),1rem)}.card:where(.astro-v5tidmuc):nth-child(4n+1){--sl-card-border: var(--sl-color-orange);--sl-card-bg: var(--sl-color-orange-low)}.card:where(.astro-v5tidmuc):nth-child(4n+3){--sl-card-border: var(--sl-color-green);--sl-card-bg: var(--sl-color-green-low)}.card:where(.astro-v5tidmuc):nth-child(4n+4){--sl-card-border: var(--sl-color-red);--sl-card-bg: var(--sl-color-red-low)}.card:where(.astro-v5tidmuc):nth-child(4n+5){--sl-card-border: var(--sl-color-blue);--sl-card-bg: var(--sl-color-blue-low)}.title:where(.astro-v5tidmuc){font-weight:600;font-size:var(--sl-text-h4);color:var(--sl-color-white);line-height:var(--sl-line-height-headings);gap:1rem;align-items:center}.card:where(.astro-v5tidmuc) .icon:where(.astro-v5tidmuc){border:1px solid var(--sl-card-border);background-color:var(--sl-card-bg);padding:.2em;border-radius:.25rem}.card:where(.astro-v5tidmuc) .body:where(.astro-v5tidmuc){margin:0;font-size:clamp(var(--sl-text-sm),calc(.5rem + 1vw),var(--sl-text-body))} label:where(.astro-4yphtoen){--sl-label-icon-size: .875rem;--sl-caret-size: 1.25rem;--sl-inline-padding: .5rem;position:relative;display:flex;align-items:center;gap:.25rem;color:var(--sl-color-gray-1)}label:where(.astro-4yphtoen):hover{color:var(--sl-color-gray-2)}.icon:where(.astro-4yphtoen){position:absolute;top:50%;transform:translateY(-50%);pointer-events:none}.label-icon:where(.astro-4yphtoen){font-size:var(--sl-label-icon-size);inset-inline-start:0}.caret:where(.astro-4yphtoen){font-size:var(--sl-caret-size);inset-inline-end:0}select:where(.astro-4yphtoen){border:0;padding-block:.625rem;padding-inline:calc(var(--sl-label-icon-size) + var(--sl-inline-padding) + .25rem) calc(var(--sl-caret-size) + var(--sl-inline-padding) + .25rem);margin-inline:calc(var(--sl-inline-padding) * -1);width:calc(var(--sl-select-width) + var(--sl-inline-padding) * 2);background-color:transparent;text-overflow:ellipsis;color:inherit;cursor:pointer;-webkit-appearance:none;-moz-appearance:none;appearance:none}option:where(.astro-4yphtoen){background-color:var(--sl-color-bg-nav);color:var(--sl-color-gray-1)}@media (min-width: 50rem){select:where(.astro-4yphtoen){font-size:var(--sl-text-sm)}} .right-sidebar-panel:where(.astro-pb3aqygn){padding:1rem var(--sl-sidebar-pad-x)}.sl-container:where(.astro-pb3aqygn){width:calc(var(--sl-sidebar-width) - 2 * var(--sl-sidebar-pad-x))}.right-sidebar-panel:where(.astro-pb3aqygn) h2{color:var(--sl-color-white);font-size:var(--sl-text-h5);font-weight:600;line-height:var(--sl-line-height-headings);margin-bottom:.5rem}.right-sidebar-panel:where(.astro-pb3aqygn) :where(a){display:block;font-size:var(--sl-text-xs);text-decoration:none;color:var(--sl-color-gray-3);overflow-wrap:anywhere}.right-sidebar-panel:where(.astro-pb3aqygn) :where(a):hover{color:var(--sl-color-white)}@media (min-width: 72rem){.sl-container:where(.astro-pb3aqygn){max-width:calc(((100vw - var(--sl-sidebar-width) - 2 * var(--sl-content-pad-x) - 2 * var(--sl-sidebar-pad-x)) * .25))}} h1:where(.astro-j6tvhyss){margin-top:1rem;font-size:var(--sl-text-h1);line-height:var(--sl-line-height-headings);font-weight:600;color:var(--sl-color-white)} ul:where(.astro-g2bywc46){padding:0;list-style:none}a:where(.astro-g2bywc46){--pad-inline: .5rem;display:block;border-radius:.25rem;padding-block:.25rem;padding-inline:calc(1rem * var(--depth) + var(--pad-inline)) var(--pad-inline);line-height:1.25}a:where(.astro-g2bywc46)[aria-current=true]{color:var(--sl-color-text-accent)}.isMobile:where(.astro-g2bywc46) a:where(.astro-g2bywc46){--pad-inline: 1rem;display:flex;justify-content:space-between;gap:var(--pad-inline);border-top:1px solid var(--sl-color-gray-6);border-radius:0;padding-block:.5rem;color:var(--sl-color-text);font-size:var(--sl-text-sm);text-decoration:none;outline-offset:var(--sl-outline-offset-inside)}.isMobile:where(.astro-g2bywc46):first-child>li:where(.astro-g2bywc46):first-child>a:where(.astro-g2bywc46){border-top:0}.isMobile:where(.astro-g2bywc46) a:where(.astro-g2bywc46)[aria-current=true],.isMobile:where(.astro-g2bywc46) a:where(.astro-g2bywc46)[aria-current=true]:hover,.isMobile:where(.astro-g2bywc46) a:where(.astro-g2bywc46)[aria-current=true]:focus{color:var(--sl-color-white);background-color:unset}.isMobile:where(.astro-g2bywc46) a:where(.astro-g2bywc46)[aria-current=true]:after{content:"";width:1rem;background-color:var(--sl-color-text-accent);-webkit-mask-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAxNCAxNCc+PHBhdGggZD0nTTEwLjkxNCA0LjIwNmEuNTgzLjU4MyAwIDAgMC0uODI4IDBMNS43NCA4LjU1NyAzLjkxNCA2LjcyNmEuNTk2LjU5NiAwIDAgMC0uODI4Ljg1N2wyLjI0IDIuMjRhLjU4My41ODMgMCAwIDAgLjgyOCAwbDQuNzYtNC43NmEuNTgzLjU4MyAwIDAgMCAwLS44NTdaJy8+PC9zdmc+Cg==);mask-image:url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0naHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmcnIHZpZXdCb3g9JzAgMCAxNCAxNCc+PHBhdGggZD0nTTEwLjkxNCA0LjIwNmEuNTgzLjU4MyAwIDAgMC0uODI4IDBMNS43NCA4LjU1NyAzLjkxNCA2LjcyNmEuNTk2LjU5NiAwIDAgMC0uODI4Ljg1N2wyLjI0IDIuMjRhLjU4My41ODMgMCAwIDAgLjgyOCAwbDQuNzYtNC43NmEuNTgzLjU4MyAwIDAgMCAwLS44NTdaJy8+PC9zdmc+Cg==);-webkit-mask-repeat:no-repeat;mask-repeat:no-repeat;flex-shrink:0} nav:where(.astro-doynk5tl){position:fixed;z-index:var(--sl-z-index-toc);top:calc(var(--sl-nav-height) - 1px);inset-inline:0;border-top:1px solid var(--sl-color-gray-5);background-color:var(--sl-color-bg-nav)}@media (min-width: 50rem){nav:where(.astro-doynk5tl){inset-inline-start:var(--sl-content-inline-start, 0)}}summary:where(.astro-doynk5tl){gap:.5rem;align-items:center;height:var(--sl-mobile-toc-height);border-bottom:1px solid var(--sl-color-hairline-shade);padding:.5rem 1rem;font-size:var(--sl-text-xs);outline-offset:var(--sl-outline-offset-inside)}summary:where(.astro-doynk5tl)::marker,summary:where(.astro-doynk5tl)::-webkit-details-marker{display:none}.toggle:where(.astro-doynk5tl){flex-shrink:0;gap:1rem;align-items:center;justify-content:space-between;border:1px solid var(--sl-color-gray-5);border-radius:.5rem;padding-block:.5rem;padding-inline-start:.75rem;padding-inline-end:.5rem;line-height:1;background-color:var(--sl-color-black);-webkit-user-select:none;-moz-user-select:none;user-select:none;cursor:pointer}details:where(.astro-doynk5tl)[open] .toggle:where(.astro-doynk5tl){color:var(--sl-color-white);border-color:var(--sl-color-accent)}details:where(.astro-doynk5tl) .toggle:where(.astro-doynk5tl):hover{color:var(--sl-color-white);border-color:var(--sl-color-gray-2)}[dir=rtl] .caret:where(.astro-doynk5tl){transform:rotate(180deg)}details:where(.astro-doynk5tl)[open] .caret:where(.astro-doynk5tl){transform:rotate(90deg)}.display-current:where(.astro-doynk5tl){white-space:nowrap;text-overflow:ellipsis;overflow:hidden;color:var(--sl-color-white)}.dropdown:where(.astro-doynk5tl){--border-top: 1px;margin-top:calc(-1 * var(--border-top));border:var(--border-top) solid var(--sl-color-gray-6);border-top-color:var(--sl-color-hairline-shade);max-height:calc(85vh - var(--sl-nav-height) - var(--sl-mobile-toc-height));overflow-y:auto;background-color:var(--sl-color-black);box-shadow:var(--sl-shadow-md);overscroll-behavior:contain} a:where(.astro-wy4te6ga){color:var(--sl-color-text-accent);padding:.5em;margin:-.5em}a:where(.astro-wy4te6ga):hover{opacity:.66} .c-breadcrumbs{--color-link-breadcrumbs: inherit;--size-font-breadcrumbs: 1rem;--spacing-vertical-separator-breadcrumbs: 6px}.c-breadcrumbs .has-ellipsis{display:var(--display-ellipsis-breadcrumbs, none)}.c-breadcrumbs.is-truncated .has-ellipsis{--display-ellipsis-breadcrumbs: flex}.c-breadcrumbs.is-truncated .c-breadcrumbs__crumb{visibility:var(--visibility-truncated-breadcrumbs, hidden);position:var(--position-truncated-breadcrumbs, absolute)}.c-breadcrumbs.is-truncated .c-breadcrumbs__crumb:first-of-type,.c-breadcrumbs.is-truncated .c-breadcrumbs__crumb:last-of-type,.c-breadcrumbs.is-truncated .c-breadcrumbs__crumb.has-ellipsis{--visibility-truncated-breadcrumbs: visible;--position-truncated-breadcrumbs: relative}.c-breadcrumbs__truncated-button{background-color:transparent;border:none;padding:0;margin:0;cursor:pointer;color:var(--color-truncated-button, var(--color-link-breadcrumbs))}.c-breadcrumbs__crumbs{list-style-type:none;margin:0;padding:0;display:flex;flex-wrap:wrap}.c-breadcrumbs__crumbs:where(.has-no-separators){row-gap:var(--spacing-vertical-separator-breadcrumbs);-moz-column-gap:1rem;column-gap:1rem}.c-breadcrumbs__crumb{display:flex;align-items:center}.c-breadcrumbs__crumb:has(.c-breadcrumbs__separator) .c-breadcrumbs__separator{display:flex;align-items:center;justify-content:center;margin-inline:var(--spacing-vertical-separator-breadcrumbs)}.c-breadcrumbs__crumb:has(svg,image) :where(svg,image){max-width:var(--size-font-breadcrumbs);max-height:var(--size-font-breadcrumbs)}.c-breadcrumbs__link,.c-breadcrumbs__truncated-button{font-size:var(--size-font-breadcrumbs);text-decoration:none;color:var(--color-link-breadcrumbs);line-height:1} svg:where(.astro-c6vsoqas){color:var(--sl-icon-color);font-size:var(--sl-icon-size, 1em);width:1em;height:1em} a:where(.astro-7q3lir66){clip:rect(0,0,0,0);position:fixed;top:.75rem;inset-inline-start:.75rem}a:where(.astro-7q3lir66):focus{clip:unset;z-index:var(--sl-z-index-skiplink);display:block;padding:.5rem 1rem;text-decoration:none;color:var(--sl-color-text-invert);background-color:var(--sl-color-text-accent);box-shadow:var(--sl-shadow-lg)} .main-pane:where(.astro-67yu43on){isolation:isolate}@media (min-width: 72rem){.right-sidebar-container:where(.astro-67yu43on){order:2;position:relative;width:calc(var(--sl-sidebar-width) + (100% - var(--sl-content-width) - var(--sl-sidebar-width)) / 2)}.right-sidebar:where(.astro-67yu43on){position:fixed;top:0;border-inline-start:1px solid var(--sl-color-gray-6);padding-top:var(--sl-nav-height);width:100%;height:100vh;overflow-y:auto;scrollbar-width:none}.main-pane:where(.astro-67yu43on){width:100%}[data-has-sidebar][data-has-toc] .main-pane:where(.astro-67yu43on){--sl-content-margin-inline: auto 0;order:1;width:calc(var(--sl-content-width) + (100% - var(--sl-content-width) - var(--sl-sidebar-width)) / 2)}} .starlight-aside{padding:1rem;border-inline-start:.25rem solid var(--sl-color-asides-border);color:var(--sl-color-white)}.starlight-aside--note{--sl-color-asides-text-accent: var(--sl-color-blue-high);--sl-color-asides-border: var(--sl-color-blue);background-color:var(--sl-color-blue-low)}.starlight-aside--tip{--sl-color-asides-text-accent: var(--sl-color-purple-high);--sl-color-asides-border: var(--sl-color-purple);background-color:var(--sl-color-purple-low)}.starlight-aside--caution{--sl-color-asides-text-accent: var(--sl-color-orange-high);--sl-color-asides-border: var(--sl-color-orange);background-color:var(--sl-color-orange-low)}.starlight-aside--danger{--sl-color-asides-text-accent: var(--sl-color-red-high);--sl-color-asides-border: var(--sl-color-red);background-color:var(--sl-color-red-low)}.starlight-aside__title{display:flex;gap:.5rem;align-items:center;font-size:var(--sl-text-h5);font-weight:600;line-height:var(--sl-line-height-headings);color:var(--sl-color-asides-text-accent)}.starlight-aside__icon{font-size:1.333em;width:1em;height:1em}.starlight-aside__title+.starlight-aside__content{margin-top:.5rem}.starlight-aside__content a{color:var(--sl-color-asides-text-accent)} sl-sidebar-state-persist:where(.astro-kku4brbg){display:contents} :root{.sidebar-content{--sl-color-hairline-light: #cacaca !important;>*{a{padding:.2375em var(--sl-sidebar-item-padding-inline)!important;&[aria-current=page]{background-color:unset!important;border:unset!important;border-color:unset!important;color:var(--sl-color-accent)!important;font-weight:600!important}}summary{padding:.1375em var(--sl-sidebar-item-padding-inline)!important}.large{color:var(--sl-color-gray-2)!important;font-weight:unset!important;font-size:unset!important;@media (min-width: 50rem){font-size:var(--sl-text-sm)!important}}.caret{font-size:1rem!important}}}}:root[data-theme=dark]{.sidebar-content{--sl-color-hairline-light: #444444 !important}} .starlight-aside{border:unset;border-radius:4px;&.starlight-aside--note{background-color:#ecf4ff}&.starlight-aside--caution{background-color:#fff8e4}.starlight-aside__title{margin-left:30px;svg{margin-left:-30px}}.starlight-aside__content{margin-top:unset;margin-left:30px}}:root[data-theme=dark]{.starlight-aside--note{background-color:#001c43}.starlight-aside--caution{background-color:#62490a}} .social-icons:where(.astro-wu23bvmt){margin-inline-end:auto;gap:1rem;align-items:center;padding-block:1rem}.social-icons:where(.astro-wu23bvmt):empty{display:none}.mobile-preferences:where(.astro-wu23bvmt){justify-content:space-between;flex-wrap:wrap;border-top:1px solid var(--sl-color-gray-6);-moz-column-gap:1rem;column-gap:1rem;padding:.5rem 0} starlight-tabs:where(.astro-esqgolmp){display:block}.tablist-wrapper:where(.astro-esqgolmp){overflow-x:auto}:where(.astro-esqgolmp)[role=tablist]{display:flex;list-style:none;border-bottom:2px solid var(--sl-color-gray-5);padding:0}.tab:where(.astro-esqgolmp){margin-bottom:-2px}.tab:where(.astro-esqgolmp)>:where(.astro-esqgolmp)[role=tab]{display:flex;align-items:center;gap:.5rem;padding:0 1.25rem;text-decoration:none;border-bottom:2px solid var(--sl-color-gray-5);color:var(--sl-color-gray-3);outline-offset:var(--sl-outline-offset-inside);overflow-wrap:initial}.tab:where(.astro-esqgolmp) :where(.astro-esqgolmp)[role=tab][aria-selected=true]{color:var(--sl-color-white);border-color:var(--sl-color-text-accent);font-weight:600}.tablist-wrapper:where(.astro-esqgolmp)~[role=tabpanel]{margin-top:1rem} :root{--sl-text-h4: var(--sl-text-base);--sl-text-h5: var(--sl-text-base)} html:not([data-has-toc]){--sl-mobile-toc-height: 0rem}html:not([data-has-sidebar]){--sl-content-width: 67.5rem}html{scroll-padding-top:calc(1.5rem + var(--sl-nav-height) + var(--sl-mobile-toc-height))}main:where(.astro-bguv2lll){padding-bottom:3vh}@media (min-width: 50em){:where(.astro-bguv2lll)[data-has-sidebar]{--sl-content-inline-start: var(--sl-sidebar-width)}}@media (min-width: 72em){html{scroll-padding-top:calc(1.5rem + var(--sl-nav-height))}} .sl-link-card:where(.astro-mf7fz2mj){display:grid;grid-template-columns:1fr auto;gap:.5rem;border:1px solid var(--sl-color-gray-5);border-radius:.5rem;padding:1rem;box-shadow:var(--sl-shadow-sm);position:relative}a:where(.astro-mf7fz2mj){text-decoration:none;line-height:var(--sl-line-height-headings)}a:where(.astro-mf7fz2mj):before{content:"";position:absolute;inset:0}.stack:where(.astro-mf7fz2mj){flex-direction:column;gap:.5rem}.title:where(.astro-mf7fz2mj){color:var(--sl-color-white);font-weight:600;font-size:var(--sl-text-lg)}.description:where(.astro-mf7fz2mj){color:var(--sl-color-gray-3);line-height:1.5}.icon:where(.astro-mf7fz2mj){color:var(--sl-color-gray-3)}.sl-link-card:where(.astro-mf7fz2mj):hover{background:var(--sl-color-gray-7, var(--sl-color-gray-6));border-color:var(--sl-color-gray-2)}.sl-link-card:where(.astro-mf7fz2mj):hover .icon:where(.astro-mf7fz2mj){color:var(--sl-color-white)} input,select{background-color:var(--sl-color-bg-nav);border-color:var(--sl-color-gray-5);border-width:2px}input[readonly]{background-color:var(--sl-color-backdrop-overlay);cursor:not-allowed} .sl-steps{--bullet-size: calc(var(--sl-line-height) * 1rem);--bullet-margin: .375rem;list-style:none;counter-reset:steps-counter var(--sl-steps-start, 0);padding-inline-start:0}.sl-steps>li{counter-increment:steps-counter;position:relative;padding-inline-start:calc(var(--bullet-size) + 1rem);padding-bottom:1px;min-height:calc(var(--bullet-size) + var(--bullet-margin))}.sl-steps>li+li{margin-top:0}.sl-steps>li:before{content:counter(steps-counter);position:absolute;top:0;inset-inline-start:0;width:var(--bullet-size);height:var(--bullet-size);line-height:var(--bullet-size);font-size:var(--sl-text-xs);font-weight:600;text-align:center;color:var(--sl-color-white);background-color:var(--sl-color-gray-6);border-radius:99rem;box-shadow:inset 0 0 0 1px var(--sl-color-gray-5)}.sl-steps>li:after{--guide-width: 1px;content:"";position:absolute;top:calc(var(--bullet-size) + var(--bullet-margin));bottom:var(--bullet-margin);inset-inline-start:calc((var(--bullet-size) - var(--guide-width)) / 2);width:var(--guide-width);background-color:var(--sl-color-hairline-light)}.sl-steps>li>:first-child{--lh: calc(1em * var(--sl-line-height));--shift-y: calc(.5 * (var(--bullet-size) - var(--lh)));transform:translateY(var(--shift-y));margin-bottom:var(--shift-y)}.sl-steps>li>:first-child:where(h1,h2,h3,h4,h5,h6){--lh: calc(1em * var(--sl-line-height-headings))}@supports (--prop: 1lh){.sl-steps>li>:first-child{--lh: 1lh}} kbd{border:1px solid rgb(251 146 60);border-radius:.25rem;background-color:#fb923c1a;padding:.1rem} starlight-file-tree:where(.astro-p67cqifm){--x-space: 1.5rem;--y-space: .125rem;--y-pad: 0;display:block;border:1px solid var(--sl-color-gray-5);padding:1rem;background-color:var(--sl-color-gray-6);font-size:var(--sl-text-xs);font-family:var(--__sl-font-mono);overflow-x:auto}starlight-file-tree:where(.astro-p67cqifm) .directory>details{border:0;padding:0;padding-inline-start:var(--x-space);background:transparent}starlight-file-tree:where(.astro-p67cqifm) .directory>details>summary{margin-inline-start:calc(-1 * var(--x-space));border:0;padding:var(--y-pad) .625rem;font-weight:400;color:var(--sl-color-white);max-width:100%}starlight-file-tree:where(.astro-p67cqifm) .directory>details>summary::marker,starlight-file-tree:where(.astro-p67cqifm) .directory>details>summary::-webkit-details-marker{color:var(--sl-color-gray-3)}starlight-file-tree:where(.astro-p67cqifm) .directory>details>summary:hover,starlight-file-tree:where(.astro-p67cqifm) .directory>details>summary:hover .tree-icon{cursor:pointer;color:var(--sl-color-text-accent);fill:var(--sl-color-text-accent)}starlight-file-tree:where(.astro-p67cqifm) .directory>details>summary:hover~ul{border-color:var(--sl-color-gray-4)}starlight-file-tree:where(.astro-p67cqifm) .directory>details>summary:hover .highlight .tree-icon{fill:var(--sl-color-text-invert)}starlight-file-tree:where(.astro-p67cqifm) ul{margin-inline-start:.5rem;border-inline-start:1px solid var(--sl-color-gray-5);padding:0;padding-inline-start:.125rem;list-style:none}starlight-file-tree:where(.astro-p67cqifm)>ul{margin:0;border:0;padding:0}starlight-file-tree:where(.astro-p67cqifm) li{margin:var(--y-space) 0;padding:var(--y-pad) 0}starlight-file-tree:where(.astro-p67cqifm) .file{margin-inline-start:calc(var(--x-space) - .125rem);color:var(--sl-color-white)}starlight-file-tree:where(.astro-p67cqifm) .tree-entry{display:inline-flex;align-items:flex-start;flex-wrap:wrap;max-width:calc(100% - 1rem)}@media (min-width: 30em){starlight-file-tree:where(.astro-p67cqifm) .tree-entry{flex-wrap:nowrap}}starlight-file-tree:where(.astro-p67cqifm) .tree-entry>:first-child{flex-shrink:0}starlight-file-tree:where(.astro-p67cqifm) .empty{color:var(--sl-color-gray-3);padding-inline-start:.375rem}starlight-file-tree:where(.astro-p67cqifm) .comment{color:var(--sl-color-gray-3);padding-inline-start:1.625rem;max-width:24rem;min-width:12rem}starlight-file-tree:where(.astro-p67cqifm) .highlight{display:inline-block;border-radius:.25rem;padding-inline-end:.5rem;color:var(--sl-color-text-invert);background-color:var(--sl-color-text-accent)}starlight-file-tree:where(.astro-p67cqifm) svg{display:inline;fill:var(--sl-color-gray-3);vertical-align:middle;margin-inline:.25rem .375rem;width:.875rem;height:.875rem}starlight-file-tree:where(.astro-p67cqifm) .highlight svg.tree-icon{fill:var(--sl-color-text-invert)} ul:where(.astro-3ii7xxms){--sl-sidebar-item-padding-inline: .5rem;list-style:none;padding:0}li:where(.astro-3ii7xxms){overflow-wrap:anywhere}ul:where(.astro-3ii7xxms) ul:where(.astro-3ii7xxms) li:where(.astro-3ii7xxms){margin-inline-start:var(--sl-sidebar-item-padding-inline);border-inline-start:1px solid var(--sl-color-hairline-light);padding-inline-start:var(--sl-sidebar-item-padding-inline)}.large:where(.astro-3ii7xxms){font-size:var(--sl-text-lg);font-weight:600;color:var(--sl-color-white)}.top-level:where(.astro-3ii7xxms)>li:where(.astro-3ii7xxms)+li:where(.astro-3ii7xxms){margin-top:.75rem}summary:where(.astro-3ii7xxms){display:flex;align-items:center;justify-content:space-between;padding:.2em var(--sl-sidebar-item-padding-inline);line-height:1.4;cursor:pointer;-webkit-user-select:none;-moz-user-select:none;user-select:none}summary:where(.astro-3ii7xxms)::marker,summary:where(.astro-3ii7xxms)::-webkit-details-marker{display:none}.caret:where(.astro-3ii7xxms){transition:transform .2s ease-in-out;flex-shrink:0}[dir=rtl] .caret:where(.astro-3ii7xxms){transform:rotate(180deg)}:where(.astro-3ii7xxms)[open]>summary:where(.astro-3ii7xxms) .caret:where(.astro-3ii7xxms){transform:rotate(90deg)}a:where(.astro-3ii7xxms){display:block;border-radius:.25rem;text-decoration:none;color:var(--sl-color-gray-2);padding:.3em var(--sl-sidebar-item-padding-inline);line-height:1.4}a:where(.astro-3ii7xxms):hover,a:where(.astro-3ii7xxms):focus{color:var(--sl-color-white)}:where(.astro-3ii7xxms)[aria-current=page],:where(.astro-3ii7xxms)[aria-current=page]:hover,:where(.astro-3ii7xxms)[aria-current=page]:focus{font-weight:600;color:var(--sl-color-text-invert);background-color:var(--sl-color-text-accent)}a:where(.astro-3ii7xxms)>:where(.astro-3ii7xxms):not(:last-child),.group-label:where(.astro-3ii7xxms)>:where(.astro-3ii7xxms):not(:last-child){margin-inline-end:.25em}@media (min-width: 50rem){.top-level:where(.astro-3ii7xxms)>li:where(.astro-3ii7xxms)+li:where(.astro-3ii7xxms){margin-top:.5rem}.large:where(.astro-3ii7xxms){font-size:var(--sl-text-base)}a:where(.astro-3ii7xxms){font-size:var(--sl-text-sm)}} :root{--color-link-breadcrumbs: var(--sl-color-text-accent)} .littlefoot{--popover-font-family: var(--sl-font-system);--popover-background-color: var(--sl-color-bg);--popover-text-color: var(--sl-color-white)}.littlefoot__content>p>a{color:var(--sl-color-text-accent)}.data-footnote-backref{display:none} .sl-link-button:where(.astro-xwgiixxa){align-items:center;border:1px solid transparent;border-radius:999rem;display:inline-flex;font-size:var(--sl-text-sm);gap:.5em;line-height:1.1875;outline-offset:.25rem;padding:.4375rem 1.125rem;text-decoration:none}.sl-link-button:where(.astro-xwgiixxa).primary{background:var(--sl-color-text-accent);border-color:var(--sl-color-text-accent);color:var(--sl-color-black)}.sl-link-button:where(.astro-xwgiixxa).primary:hover{color:var(--sl-color-black)}.sl-link-button:where(.astro-xwgiixxa).secondary{border-color:inherit;color:var(--sl-color-white)}.sl-link-button:where(.astro-xwgiixxa).minimal{color:var(--sl-color-white);padding-inline:0}.sl-link-button:where(.astro-xwgiixxa) svg{flex-shrink:0}@media (min-width: 50rem){.sl-link-button:where(.astro-xwgiixxa){font-size:var(--sl-text-base);padding:.9375rem 1.25rem}}.sl-markdown-content .sl-link-button:where(.astro-xwgiixxa){margin-inline-end:1rem}.sl-markdown-content .sl-link-button:where(.astro-xwgiixxa):not(:where(p *)){margin-block:1rem} pre.mermaid:not([data-processed]){visibility:hidden} table *{overflow-wrap:normal} </style> <link rel="stylesheet" href="/_astro/tailwind.CD_bkva8.css"> <style>.site-title{gap:calc(.5 * var(--sl-nav-gap));span{color:var(--sl-color-white)}img{height:calc(var(--sl-nav-height) - 3 * var(--sl-nav-pad-y))}} fieldset:where(.astro-x6kpz2mu){padding-top:0;padding-left:0}label:where(.astro-x6kpz2mu){font-size:small;color:var(--sl-color-gray-3)}input:where(.astro-x6kpz2mu)::-moz-placeholder{font-size:x-small}input:where(.astro-x6kpz2mu)[type=submit],input:where(.astro-x6kpz2mu)::placeholder{font-size:x-small}h2:where(.astro-x6kpz2mu){color:var(--sl-color-white);font-size:var(--sl-text-h5);font-weight:600;line-height:var(--sl-line-height-headings);margin-bottom:.5rem}#info:where(.astro-x6kpz2mu){display:none}#other:where(.astro-x6kpz2mu):checked~#info:where(.astro-x6kpz2mu){display:flex}:where(.astro-x6kpz2mu)[data-icon]{cursor:pointer;color:var(--sl-color-gray-3);font-size:1.5rem;margin-right:.5rem;&:hover{color:var(--sl-color-text-accent);border-color:var(--sl-color-text-accent)}} </style> <link rel="stylesheet" href="/_astro/tooltips.CEnw8Nk_.css"> <style>.hero:where(.astro-opidluyl){display:grid;align-items:center;gap:1rem;padding-bottom:1rem}.hero:where(.astro-opidluyl)>img:where(.astro-opidluyl),.hero:where(.astro-opidluyl)>.hero-html:where(.astro-opidluyl){-o-object-fit:contain;object-fit:contain;width:min(70%,20rem);height:auto;margin-inline:auto}.stack:where(.astro-opidluyl){flex-direction:column;gap:clamp(1.5rem,calc(1.5rem + 1vw),2rem);text-align:center}.copy:where(.astro-opidluyl){flex-direction:column;gap:1rem;align-items:center}a:where(.astro-opidluyl){color:var(--sl-color-white)}h1:where(.astro-opidluyl){font-size:clamp(var(--sl-text-3xl),calc(.25rem + 5vw),var(--sl-text-6xl));line-height:var(--sl-line-height-headings);font-weight:600;color:var(--sl-color-white)}.tagline:where(.astro-opidluyl){font-size:clamp(var(--sl-text-base),calc(.0625rem + 2vw),var(--sl-text-xl));color:var(--sl-color-gray-2)}.actions:where(.astro-opidluyl){gap:1rem 2rem;flex-wrap:wrap;justify-content:center}.copy:where(.astro-opidluyl)>.links:where(.astro-opidluyl){gap:0;flex-direction:row;flex-wrap:wrap}@media (min-width: 50rem){.hero:where(.astro-opidluyl){grid-template-columns:7fr 4fr;gap:3%;padding-block:clamp(2.5rem,calc(1rem + 10vmin),10rem)}.hero:where(.astro-opidluyl)>img:where(.astro-opidluyl),.hero:where(.astro-opidluyl)>.hero-html:where(.astro-opidluyl){order:2;width:min(100%,25rem)}.stack:where(.astro-opidluyl){text-align:start}.copy:where(.astro-opidluyl){align-items:flex-start}.actions:where(.astro-opidluyl){justify-content:flex-start}} .NetworkMap--land:where(.astro-x5fqlrwg){fill:rgba(var(--gray-7-rgb),.8)}:where(.astro-x5fqlrwg)[theme=dark] .NetworkMap--land:where(.astro-x5fqlrwg){fill:rgba(var(--gray-2-rgb),.7)}.NetworkMap--datacenters:where(.astro-x5fqlrwg){fill:var(--sl-color-text-accent);stroke:var(--sl-color-text-accent);stroke-width:2px;paint-order:stroke;opacity:.85}:where(.astro-x5fqlrwg)[theme=dark] .NetworkMap--datacenters:where(.astro-x5fqlrwg){stroke:var(--background-color);stroke-width:3px} .card:where(.astro-rcyev3ef){--sl-card-border: var(--sl-color-purple);--sl-card-bg: var(--sl-color-purple-low);border:1px solid var(--sl-color-gray-5);background-color:var(--sl-color-black);padding:clamp(1rem,calc(.125rem + 3vw),2.5rem);flex-direction:column;gap:clamp(.5rem,calc(.125rem + 1vw),1rem)}.card:where(.astro-rcyev3ef):nth-child(4n+1){--sl-card-border: var(--sl-color-orange);--sl-card-bg: var(--sl-color-orange-low)}.card:where(.astro-rcyev3ef):nth-child(4n+3){--sl-card-border: var(--sl-color-green);--sl-card-bg: var(--sl-color-green-low)}.card:where(.astro-rcyev3ef):nth-child(4n+4){--sl-card-border: var(--sl-color-red);--sl-card-bg: var(--sl-color-red-low)}.card:where(.astro-rcyev3ef):nth-child(4n+5){--sl-card-border: var(--sl-color-blue);--sl-card-bg: var(--sl-color-blue-low)}.title:where(.astro-rcyev3ef){font-weight:600;font-size:var(--sl-text-h4);color:var(--sl-color-white);line-height:var(--sl-line-height-headings);gap:1rem;align-items:center}.title:where(.astro-rcyev3ef)>a:where(.astro-rcyev3ef){color:var(--sl-color-white)!important;text-decoration-color:var(--sl-color-accent)!important}.card:where(.astro-rcyev3ef) .icon:where(.astro-rcyev3ef){border:1px solid var(--sl-card-border);background-color:var(--sl-card-bg);padding:.2em;border-radius:.25rem}.card:where(.astro-rcyev3ef) .body:where(.astro-rcyev3ef){margin:0;font-size:clamp(var(--sl-text-sm),calc(.5rem + 1vw),var(--sl-text-body))} a:where(.astro-vdgantbb){color:var(--sl-color-text-accent)} </style> <link rel="stylesheet" href="/_astro/WorkersIsolateDiagram_astro_astro_type_style_index_0_lang.Bc7tm2R7.css"> <style>.card-grid:where(.astro-lrh2lqny){display:grid;gap:1rem}.card-grid:where(.astro-lrh2lqny)>*{margin-top:0!important}@media (min-width: 50rem){.card-grid:where(.astro-lrh2lqny){grid-template-columns:1fr 1fr 1fr 1fr;gap:1.5rem}.stagger:where(.astro-lrh2lqny){--stagger-height: 5rem;padding-bottom:var(--stagger-height)}.stagger:where(.astro-lrh2lqny)>*:nth-child(2n){transform:translateY(var(--stagger-height))}} .link-list:where(.astro-5tgmqq4m) ul{list-style-type:none;padding:0}.link-list:where(.astro-5tgmqq4m) li{border-bottom:1px solid var(--sl-color-gray-6);padding:.25rem 0;margin:0!important}.link-list:where(.astro-5tgmqq4m) li:last-child{border-bottom:none}.link-list:where(.astro-5tgmqq4m) a{display:flex;gap:.5rem;justify-content:space-between;align-items:center;text-decoration:none}.link-list:where(.astro-5tgmqq4m) a:after{content:"";background-color:currentColor;width:1rem;height:1rem;flex-shrink:0;mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17.92 11.62a1.001 1.001 0 0 0-.21-.33l-5-5a1.003 1.003 0 1 0-1.42 1.42l3.3 3.29H7a1 1 0 0 0 0 2h7.59l-3.3 3.29a1.002 1.002 0 0 0 .325 1.639 1 1 0 0 0 1.095-.219l5-5a1 1 0 0 0 .21-.33 1 1 0 0 0 0-.76Z'%3E%3C/path%3E%3C/svg%3E");-webkit-mask-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M17.92 11.62a1.001 1.001 0 0 0-.21-.33l-5-5a1.003 1.003 0 1 0-1.42 1.42l3.3 3.29H7a1 1 0 0 0 0 2h7.59l-3.3 3.29a1.002 1.002 0 0 0 .325 1.639 1 1 0 0 0 1.095-.219l5-5a1 1 0 0 0 .21-.33 1 1 0 0 0 0-.76Z'%3E%3C/path%3E%3C/svg%3E");mask-size:100%;-webkit-mask-size:100%}[dir=rtl] .link-list:where(.astro-5tgmqq4m) a:after:not(:where([dir=rtl] [dir=ltr] *)){transform:scaleX(-1)} </style> <link rel="stylesheet" href="/_astro/FooterHeroBlock_astro_astro_type_style_index_0_lang.C0EyG241.css"> <style>input:where(.astro-75f4fhkp)[type=radio]{display:none}:root{--active-background: rgb(46 105 255);--hover-background: rgb(46 105 255 / .5);--active-text-color: white}:root[data-theme=dark]{--active-background: rgb(246 130 31);--hover-background: rgb(246 130 31 / .5);--active-text-color: black}#section1:where(.astro-75f4fhkp):checked~.tryit-code:where(.astro-75f4fhkp) #section1Content:where(.astro-75f4fhkp),#section2:where(.astro-75f4fhkp):checked~.tryit-code:where(.astro-75f4fhkp) #section2Content:where(.astro-75f4fhkp),#section3:where(.astro-75f4fhkp):checked~.tryit-code:where(.astro-75f4fhkp) #section3Content:where(.astro-75f4fhkp),#section4:where(.astro-75f4fhkp):checked~.tryit-code:where(.astro-75f4fhkp) #section4Content:where(.astro-75f4fhkp),#section5:where(.astro-75f4fhkp):checked~.tryit-code:where(.astro-75f4fhkp) #section5Content:where(.astro-75f4fhkp){display:block}#section1:where(.astro-75f4fhkp):checked~.tryit-sidebar:where(.astro-75f4fhkp) #section1Label:where(.astro-75f4fhkp),#section2:where(.astro-75f4fhkp):checked~.tryit-sidebar:where(.astro-75f4fhkp) #section2Label:where(.astro-75f4fhkp),#section3:where(.astro-75f4fhkp):checked~.tryit-sidebar:where(.astro-75f4fhkp) #section3Label:where(.astro-75f4fhkp),#section4:where(.astro-75f4fhkp):checked~.tryit-sidebar:where(.astro-75f4fhkp) #section4Label:where(.astro-75f4fhkp),#section5:where(.astro-75f4fhkp):checked~.tryit-sidebar:where(.astro-75f4fhkp) #section5Label:where(.astro-75f4fhkp){background-color:var(--active-background);color:var(--active-text-color)}.tryit-sidebar:where(.astro-75f4fhkp) label:where(.astro-75f4fhkp):hover{background-color:var(--hover-background)} </style> <script type="module" src="/_astro/page.7qqag-5g.js"></script> <meta http-equiv="X-Translated-By" content="Google"> <meta http-equiv="X-Translated-To" content="en"> <script type="text/javascript" src="https://www.gstatic.com/_/translate_http/_/js/k=translate_http.tr.en_GB.omlEigW4xY8.O/am=DgY/d=1/rs=AN8SPfpjsL9kUWY0h-sp7Ilu7hZWGwEmeg/m=corsproxy" data-sourceurl="https://developers.cloudflare.com/queues/configuration/javascript-apis/"></script> <link href="https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200" rel="stylesheet"> <script type="text/javascript" src="https://www.gstatic.com/_/translate_http/_/js/k=translate_http.tr.en_GB.omlEigW4xY8.O/am=DgY/d=1/exm=corsproxy/ed=1/rs=AN8SPfpjsL9kUWY0h-sp7Ilu7hZWGwEmeg/m=phishing_protection" data-phishing-protection-enabled="false" data-forms-warning-enabled="true" data-source-url="https://developers.cloudflare.com/queues/configuration/javascript-apis/"></script> <meta name="robots" content="none"> </head> <body class="astro-bguv2lll"> <script type="text/javascript" src="https://www.gstatic.com/_/translate_http/_/js/k=translate_http.tr.en_GB.omlEigW4xY8.O/am=DgY/d=1/exm=corsproxy,phishing_protection/ed=1/rs=AN8SPfpjsL9kUWY0h-sp7Ilu7hZWGwEmeg/m=navigationui" data-environment="prod" data-proxy-url="https://developers-cloudflare-com.translate.goog" data-proxy-full-url="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" data-source-url="https://developers.cloudflare.com/queues/configuration/javascript-apis/" data-source-language="pl" data-target-language="en" data-display-language="en-GB" data-detected-source-language="" data-is-source-untranslated="false" data-source-untranslated-url="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://developers.cloudflare.com/queues/configuration/javascript-apis/&anno=2" data-client="tr"></script><!-- Keep the default skip link in place --><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#_top" class="astro-7q3lir66">Skip to content</a> <div class="page sl-flex astro-vrdttmbt"> <header class="header astro-vrdttmbt"> <div class="header sl-flex astro-kmkmnagf"> <div class="title-wrapper sl-flex astro-kmkmnagf"><a href="https://developers-cloudflare-com.translate.goog/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="site-title sl-flex astro-m46x6ez3"> <img class="astro-m46x6ez3" alt="" src="/_astro/logo.p_ySeMR1.svg" width="40" height="19"> <span class="astro-m46x6ez3"> Cloudflare Docs </span> </a> </div> <div class="sl-flex astro-kmkmnagf"><sl-doc-search data-translations="{"placeholder":"Search","translations":{"button":{"buttonText":"Search","buttonAriaLabel":"Search"},"modal":{"searchBox":{},"startScreen":{},"errorScreen":{},"footer":{},"noResultsScreen":{}}}}"> <button type="button" class="DocSearch DocSearch-Button" aria-label="Search"> <span class="DocSearch-Button-Container"> <svg width="20" height="20" class="DocSearch-Search-Icon" viewbox="0 0 20 20"><path d="M14.386 14.386l4.0877 4.0877-4.0877-4.0877c-2.9418 2.9419-7.7115 2.9419-10.6533 0-2.9419-2.9418-2.9419-7.7115 0-10.6533 2.9418-2.9419 7.7115-2.9419 10.6533 0 2.9419 2.9418 2.9419 7.7115 0 10.6533z" stroke="currentColor" fill="none" fill-rule="evenodd" stroke-linecap="round" stroke-linejoin="round" /> </svg><span class="DocSearch-Button-Placeholder">Search</span> </span> <span class="DocSearch-Button-Keys"></span> </button> </sl-doc-search> <script type="module" src="/_astro/DocSearch.astro_astro_type_script_index_0_lang.CycYJ8Jr.js"></script> </div> <div class="sl-hidden md:sl-flex right-group astro-kmkmnagf"> <div class="sl-flex social-icons astro-kmkmnagf"> <div class="items-center hidden lg:flex mx-auto astro-r3tjzkat"><a href="https://developers-cloudflare-com.translate.goog/products/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="px-4 no-underline text-[--sl-color-text] font-medium astro-r3tjzkat"> <span class="astro-r3tjzkat">Products</span> </a><a href="https://developers-cloudflare-com.translate.goog/learning-paths/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="px-4 no-underline text-[--sl-color-text] font-medium astro-r3tjzkat"> <span class="astro-r3tjzkat">Learning</span> </a><a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://www.cloudflarestatus.com/" class="px-4 no-underline text-[--sl-color-text] font-medium astro-r3tjzkat"> <span class="astro-r3tjzkat">Status</span> </a><a href="https://developers-cloudflare-com.translate.goog/support/contacting-cloudflare-support/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="px-4 no-underline text-[--sl-color-text] font-medium astro-r3tjzkat"> <span class="astro-r3tjzkat">Support</span> </a><a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://dash.cloudflare.com" class="px-4 no-underline text-[--sl-color-text] font-medium astro-r3tjzkat"> <span class="astro-r3tjzkat">Log in</span> </a> </div><a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://github.com/cloudflare/cloudflare-docs" rel="me" class="sl-flex astro-wy4te6ga"><span class="sr-only astro-wy4te6ga">GitHub</span> <svg aria-hidden="true" class="astro-wy4te6ga astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"> <path d="M12 .3a12 12 0 0 0-3.8 23.38c.6.12.83-.26.83-.57L9 21.07c-3.34.72-4.04-1.61-4.04-1.61-.55-1.39-1.34-1.76-1.34-1.76-1.08-.74.09-.73.09-.73 1.2.09 1.83 1.24 1.83 1.24 1.08 1.83 2.81 1.3 3.5 1 .1-.78.42-1.31.76-1.61-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.14-.3-.54-1.52.1-3.18 0 0 1-.32 3.3 1.23a11.5 11.5 0 0 1 6 0c2.28-1.55 3.29-1.23 3.29-1.23.64 1.66.24 2.88.12 3.18a4.65 4.65 0 0 1 1.23 3.22c0 4.61-2.8 5.63-5.48 5.92.42.36.81 1.1.81 2.22l-.01 3.29c0 .31.2.69.82.57A12 12 0 0 0 12 .3Z" /> </svg></a><a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://x.com/cloudflare" rel="me" class="sl-flex astro-wy4te6ga"><span class="sr-only astro-wy4te6ga">X</span> <svg aria-hidden="true" class="astro-wy4te6ga astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"> <path d="M 18.242188 2.25 L 21.554688 2.25 L 14.324219 10.507812 L 22.828125 21.75 L 16.171875 21.75 L 10.953125 14.933594 L 4.992188 21.75 L 1.679688 21.75 L 9.40625 12.914062 L 1.257812 2.25 L 8.082031 2.25 L 12.792969 8.480469 Z M 17.082031 19.773438 L 18.914062 19.773438 L 7.082031 4.125 L 5.113281 4.125 Z M 17.082031 19.773438 " /> </svg></a><a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://www.youtube.com/cloudflare" rel="me" class="sl-flex astro-wy4te6ga"><span class="sr-only astro-wy4te6ga">YouTube</span> <svg aria-hidden="true" class="astro-wy4te6ga astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"> <path d="M23.5 6.2A3 3 0 0 0 21.4 4c-1.9-.5-9.4-.5-9.4-.5s-7.5 0-9.4.5A3 3 0 0 0 .5 6.3C0 8 0 12 0 12s0 4 .5 5.8A3 3 0 0 0 2.6 20c1.9.6 9.4.6 9.4.6s7.5 0 9.4-.6a3 3 0 0 0 2.1-2c.5-2 .5-5.9.5-5.9s0-4-.5-5.8zm-14 9.4V8.4l6.3 3.6-6.3 3.6z" /> </svg></a> </div><starlight-theme-select> <label style="--sl-select-width: 6.25em" class="astro-4yphtoen"> <span class="sr-only astro-4yphtoen">Select theme</span> <svg aria-hidden="true" class="icon label-icon astro-4yphtoen astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"> <path d="M21 14h-1V7a3 3 0 0 0-3-3H7a3 3 0 0 0-3 3v7H3a1 1 0 0 0-1 1v2a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-2a1 1 0 0 0-1-1ZM6 7a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v7H6V7Zm14 10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-1h16v1Z" /> </svg><select value="auto" class="astro-4yphtoen"> <option value="dark" class="astro-4yphtoen">Dark</option><option value="light" class="astro-4yphtoen">Light</option><option value="auto" selected class="astro-4yphtoen">Auto</option> </select> <svg aria-hidden="true" class="icon caret astro-4yphtoen astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"> <path d="M17 9.17a1 1 0 0 0-1.41 0L12 12.71 8.46 9.17a1 1 0 1 0-1.41 1.42l4.24 4.24a1.002 1.002 0 0 0 1.42 0L17 10.59a1.002 1.002 0 0 0 0-1.42Z" /> </svg></label> </starlight-theme-select> <script> StarlightThemeProvider.updatePickers(); </script> <script type="module">const r="starlight-theme",o=e=>e==="auto"||e==="dark"||e==="light"?e:"auto",c=()=>o(typeof localStorage<"u"&&localStorage.getItem(r));function n(e){typeof localStorage<"u"&&localStorage.setItem(r,e==="light"||e==="dark"?e:"")}const l=()=>matchMedia("(prefers-color-scheme: light)").matches?"light":"dark";function t(e){StarlightThemeProvider.updatePickers(e),document.documentElement.dataset.theme=e==="auto"?l():e,n(e)}matchMedia("(prefers-color-scheme: light)").addEventListener("change",()=>{c()==="auto"&&t("auto")});class s extends HTMLElement{constructor(){super(),t(c()),this.querySelector("select")?.addEventListener("change",a=>{a.currentTarget instanceof HTMLSelectElement&&t(o(a.currentTarget.value))})}}customElements.define("starlight-theme-select",s);</script> <script type="module">class n extends HTMLElement{constructor(){super();const e=this.querySelector("select");e&&e.addEventListener("change",t=>{t.currentTarget instanceof HTMLSelectElement&&(window.location.pathname=t.currentTarget.value)})}}customElements.define("starlight-lang-select",n);</script> </div> </div> </header> <nav class="sidebar astro-vrdttmbt" aria-label="Main"><starlight-menu-button class="astro-jif73yzw"> <button aria-expanded="false" aria-label="Menu" aria-controls="starlight__sidebar" class="sl-flex md:sl-hidden astro-jif73yzw"> <svg aria-hidden="true" class="astro-jif73yzw astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"> <path d="M3 8h18a1 1 0 1 0 0-2H3a1 1 0 0 0 0 2Zm18 8H3a1 1 0 0 0 0 2h18a1 1 0 0 0 0-2Zm0-5H3a1 1 0 0 0 0 2h18a1 1 0 0 0 0-2Z" /> </svg></button> </starlight-menu-button> <script type="module">class s extends HTMLElement{constructor(){super(),this.btn=this.querySelector("button"),this.btn.addEventListener("click",()=>this.toggleExpanded());const t=this.closest("nav");t&&t.addEventListener("keyup",e=>this.closeOnEscape(e))}setExpanded(t){this.setAttribute("aria-expanded",String(t)),document.body.toggleAttribute("data-mobile-menu-expanded",t)}toggleExpanded(){this.setExpanded(this.getAttribute("aria-expanded")!=="true")}closeOnEscape(t){t.code==="Escape"&&(this.setExpanded(!1),this.btn.focus())}}customElements.define("starlight-menu-button",s);</script> <div id="starlight__sidebar" class="sidebar-pane astro-vrdttmbt"> <div class="sidebar-content sl-flex astro-vrdttmbt"><a href="https://developers-cloudflare-com.translate.goog/queues/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="items-center flex hover:opacity-80 decoration-[color:var(--orange-accent-200)]"> <svg width="1em" height="1em" class="text-[color:var(--orange-accent-200)] text-4xl mr-2" data-icon="queues"><symbol id="ai:local:queues" viewbox="0 0 40 40"> <path fill="currentColor" d="M11.154 19.894 5.33 14.21l-1.612 1.65 2.656 2.594H1.942a1.442 1.442 0 1 0 0 2.884h4.433L3.72 23.927l1.61 1.653 5.823-5.685Zm28.352 0-5.823-5.685-1.612 1.65 2.656 2.594h-4.433a1.442 1.442 0 1 0 0 2.884h4.433l-2.655 2.591 1.611 1.651z" /> <rect width="23.07" height="2.884" x="7.911" y="7" fill="currentColor" rx="1.442" /> <rect width="23.07" height="2.884" x="7.911" y="30.07" fill="currentColor" rx="1.442" /> <path fill="currentColor" d="M13.679 14.21c.796 0 1.442.645 1.442 1.441v8.651a1.442 1.442 0 1 1-2.884 0v-8.65c0-.797.646-1.443 1.442-1.443Zm5.767 0c.797 0 1.442.645 1.442 1.441v8.651a1.442 1.442 0 1 1-2.884 0v-8.65c0-.797.646-1.443 1.442-1.443Zm5.768 0c.796 0 1.442.645 1.442 1.441v8.651a1.442 1.442 0 1 1-2.884 0v-8.65c0-.797.645-1.443 1.442-1.443Z" /> </symbol><use href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#ai:local:queues"></use> </svg><span class="text-black dark:text-white"> <strong> Queues </strong> </span> </a> <!-- @ts-expect-error sidebar props don't match as we add additional things --> <sl-sidebar-state-persist data-hash="09sxz71" class="astro-kku4brbg"> <script> (() => { try { if (!matchMedia('(min-width: 50em)').matches) return; /** @type {HTMLElement | null} */ const target = document.querySelector('sl-sidebar-state-persist'); const state = JSON.parse(sessionStorage.getItem('sl-sidebar-state') || '0'); if (!target || !state || target.dataset.hash !== state.hash) return; window._starlightScrollRestore = state.scroll; customElements.define( 'sl-sidebar-restore', class SidebarRestore extends HTMLElement { connectedCallback() { try { const idx = parseInt(this.dataset.index || ''); const details = this.closest('details'); if (details && typeof state.open[idx] === 'boolean') details.open = state.open[idx]; } catch {} } } ); } catch {} })(); </script> <ul class="top-level astro-3ii7xxms"> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="large astro-3ii7xxms"> <span class="astro-3ii7xxms">Overview</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/get-started/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="large astro-3ii7xxms"> <span class="astro-3ii7xxms">Get started</span> </a></li> <li class="astro-3ii7xxms"> <details open class="astro-3ii7xxms"><sl-sidebar-restore data-index="0"></sl-sidebar-restore> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"><span class="large astro-3ii7xxms">Configuration</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"> <path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z" /> </svg></summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Overview</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/configure-queues/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Configure Queues</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/batching-retries/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Batching, Retries and Delays</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/dead-letter-queues/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Dead Letter Queues</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/pull-consumers/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Pull consumers</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/consumer-concurrency/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Consumer concurrency</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" aria-current="page" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">JavaScript APIs</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/local-development/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Local Development</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/r2/buckets/event-notifications/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">R2 Event Notifications ↗</span> </a></li> </ul> </details></li> <li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"><sl-sidebar-restore data-index="1"></sl-sidebar-restore> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"><span class="large astro-3ii7xxms">Observability</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"> <path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z" /> </svg></summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/observability/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Overview</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/observability/metrics/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Metrics</span> </a></li> </ul> </details></li> <li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"><sl-sidebar-restore data-index="2"></sl-sidebar-restore> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"><span class="large astro-3ii7xxms">Examples</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"> <path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z" /> </svg></summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/examples/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Overview</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/reference-architecture/diagrams/serverless/serverless-etl/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Serverless ETL pipelines ↗</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/examples/use-queues-with-durable-objects/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Use Queues from Durable Objects</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/examples/publish-to-a-queue-over-http/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Publish to a Queue via HTTP</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/examples/send-errors-to-r2/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Use Queues to store data in R2</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/examples/send-messages-from-dash/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Send messages from the dashboard</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/examples/list-messages-from-dash/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">List and acknowledge messages from the dashboard</span> </a></li> </ul> </details></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/tutorials/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="large astro-3ii7xxms"> <span class="astro-3ii7xxms">Tutorials</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/demos/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="large astro-3ii7xxms"> <span class="astro-3ii7xxms">Demos and architectures</span> </a></li> <li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"><sl-sidebar-restore data-index="3"></sl-sidebar-restore> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"><span class="large astro-3ii7xxms">Platform</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"> <path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z" /> </svg></summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/platform/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Overview</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/platform/pricing/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Pricing</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/platform/limits/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Limits</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/workers/platform/storage-options/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Choose a data or storage product ↗</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/platform/changelog/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Changelog</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/platform/audit-logs/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Audit Logs</span> </a></li> </ul> </details></li> <li class="astro-3ii7xxms"> <details class="astro-3ii7xxms"><sl-sidebar-restore data-index="4"></sl-sidebar-restore> <summary class="astro-3ii7xxms"> <div class="group-label astro-3ii7xxms"><span class="large astro-3ii7xxms">Reference</span> </div> <svg aria-hidden="true" class="caret astro-3ii7xxms astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.25rem;"> <path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z" /> </svg></summary> <ul class="astro-3ii7xxms"> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/reference/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Overview</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/reference/how-queues-works/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">How Queues Works</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/reference/delivery-guarantees/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Delivery guarantees</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/workers/wrangler/commands/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#queues" class="astro-3ii7xxms"> <span class="astro-3ii7xxms">Wrangler commands ↗</span> </a></li> </ul> </details></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/queues/glossary/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="large astro-3ii7xxms"> <span class="astro-3ii7xxms">Glossary</span> </a></li> <li class="astro-3ii7xxms"><a href="https://developers-cloudflare-com.translate.goog/api/operations/queue-v2-create-queue?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="large astro-3ii7xxms"> <span class="astro-3ii7xxms">Queues REST API ↗</span> <span class="sl-badge default small astro-3ii7xxms astro-avdet4wd">API</span> </a></li> </ul> <script> (() => { const scroller = document.getElementById('starlight__sidebar'); if (!window._starlightScrollRestore || !scroller) return; scroller.scrollTop = window._starlightScrollRestore; delete window._starlightScrollRestore; })(); </script> </sl-sidebar-state-persist> <div class="md:sl-hidden"> <div class="mobile-preferences sl-flex astro-wu23bvmt"> <div class="sl-flex social-icons astro-wu23bvmt"> <div class="items-center hidden lg:flex mx-auto astro-r3tjzkat"><a href="https://developers-cloudflare-com.translate.goog/products/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="px-4 no-underline text-[--sl-color-text] font-medium astro-r3tjzkat"> <span class="astro-r3tjzkat">Products</span> </a><a href="https://developers-cloudflare-com.translate.goog/learning-paths/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="px-4 no-underline text-[--sl-color-text] font-medium astro-r3tjzkat"> <span class="astro-r3tjzkat">Learning</span> </a><a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://www.cloudflarestatus.com/" class="px-4 no-underline text-[--sl-color-text] font-medium astro-r3tjzkat"> <span class="astro-r3tjzkat">Status</span> </a><a href="https://developers-cloudflare-com.translate.goog/support/contacting-cloudflare-support/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="px-4 no-underline text-[--sl-color-text] font-medium astro-r3tjzkat"> <span class="astro-r3tjzkat">Support</span> </a><a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://dash.cloudflare.com" class="px-4 no-underline text-[--sl-color-text] font-medium astro-r3tjzkat"> <span class="astro-r3tjzkat">Log in</span> </a> </div><a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://github.com/cloudflare/cloudflare-docs" rel="me" class="sl-flex astro-wy4te6ga"><span class="sr-only astro-wy4te6ga">GitHub</span> <svg aria-hidden="true" class="astro-wy4te6ga astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"> <path d="M12 .3a12 12 0 0 0-3.8 23.38c.6.12.83-.26.83-.57L9 21.07c-3.34.72-4.04-1.61-4.04-1.61-.55-1.39-1.34-1.76-1.34-1.76-1.08-.74.09-.73.09-.73 1.2.09 1.83 1.24 1.83 1.24 1.08 1.83 2.81 1.3 3.5 1 .1-.78.42-1.31.76-1.61-2.67-.3-5.47-1.33-5.47-5.93 0-1.31.47-2.38 1.24-3.22-.14-.3-.54-1.52.1-3.18 0 0 1-.32 3.3 1.23a11.5 11.5 0 0 1 6 0c2.28-1.55 3.29-1.23 3.29-1.23.64 1.66.24 2.88.12 3.18a4.65 4.65 0 0 1 1.23 3.22c0 4.61-2.8 5.63-5.48 5.92.42.36.81 1.1.81 2.22l-.01 3.29c0 .31.2.69.82.57A12 12 0 0 0 12 .3Z" /> </svg></a><a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://x.com/cloudflare" rel="me" class="sl-flex astro-wy4te6ga"><span class="sr-only astro-wy4te6ga">X</span> <svg aria-hidden="true" class="astro-wy4te6ga astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"> <path d="M 18.242188 2.25 L 21.554688 2.25 L 14.324219 10.507812 L 22.828125 21.75 L 16.171875 21.75 L 10.953125 14.933594 L 4.992188 21.75 L 1.679688 21.75 L 9.40625 12.914062 L 1.257812 2.25 L 8.082031 2.25 L 12.792969 8.480469 Z M 17.082031 19.773438 L 18.914062 19.773438 L 7.082031 4.125 L 5.113281 4.125 Z M 17.082031 19.773438 " /> </svg></a><a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://www.youtube.com/cloudflare" rel="me" class="sl-flex astro-wy4te6ga"><span class="sr-only astro-wy4te6ga">YouTube</span> <svg aria-hidden="true" class="astro-wy4te6ga astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"> <path d="M23.5 6.2A3 3 0 0 0 21.4 4c-1.9-.5-9.4-.5-9.4-.5s-7.5 0-9.4.5A3 3 0 0 0 .5 6.3C0 8 0 12 0 12s0 4 .5 5.8A3 3 0 0 0 2.6 20c1.9.6 9.4.6 9.4.6s7.5 0 9.4-.6a3 3 0 0 0 2.1-2c.5-2 .5-5.9.5-5.9s0-4-.5-5.8zm-14 9.4V8.4l6.3 3.6-6.3 3.6z" /> </svg></a> </div><starlight-theme-select> <label style="--sl-select-width: 6.25em" class="astro-4yphtoen"> <span class="sr-only astro-4yphtoen">Select theme</span> <svg aria-hidden="true" class="icon label-icon astro-4yphtoen astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"> <path d="M21 14h-1V7a3 3 0 0 0-3-3H7a3 3 0 0 0-3 3v7H3a1 1 0 0 0-1 1v2a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-2a1 1 0 0 0-1-1ZM6 7a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v7H6V7Zm14 10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-1h16v1Z" /> </svg><select value="auto" class="astro-4yphtoen"> <option value="dark" class="astro-4yphtoen">Dark</option><option value="light" class="astro-4yphtoen">Light</option><option value="auto" selected class="astro-4yphtoen">Auto</option> </select> <svg aria-hidden="true" class="icon caret astro-4yphtoen astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1em;"> <path d="M17 9.17a1 1 0 0 0-1.41 0L12 12.71 8.46 9.17a1 1 0 1 0-1.41 1.42l4.24 4.24a1.002 1.002 0 0 0 1.42 0L17 10.59a1.002 1.002 0 0 0 0-1.42Z" /> </svg></label> </starlight-theme-select> <script> StarlightThemeProvider.updatePickers(); </script> </div> </div> </div> </div> </nav> <div class="main-frame astro-vrdttmbt"> <script type="module">const a=document.getElementById("starlight__sidebar"),n=a?.querySelector("sl-sidebar-state-persist"),o="sl-sidebar-state",i=()=>{let t=[];const e=n?.dataset.hash||"";try{const s=sessionStorage.getItem(o),r=JSON.parse(s||"{}");Array.isArray(r.open)&&r.hash===e&&(t=r.open)}catch{}return{hash:e,open:t,scroll:a?.scrollTop||0}},c=t=>{try{sessionStorage.setItem(o,JSON.stringify(t))}catch{}},d=()=>c(i()),l=(t,e)=>{const s=i();s.open[e]=t,c(s)};n?.addEventListener("click",t=>{if(!(t.target instanceof Element))return;const e=t.target.closest("summary")?.closest("details");if(!e)return;const s=e.querySelector("sl-sidebar-restore"),r=parseInt(s?.dataset.index||"");isNaN(r)||l(!e.open,r)});addEventListener("visibilitychange",()=>{document.visibilityState==="hidden"&&d()});addEventListener("pageHide",d);</script> <div class="lg:sl-flex astro-67yu43on"> <aside class="right-sidebar-container astro-67yu43on"> <div class="right-sidebar astro-67yu43on"> <div class="lg:sl-hidden astro-pb3aqygn"> <mobile-starlight-toc data-min-h="2" data-max-h="3" class="astro-doynk5tl"> <nav aria-labelledby="starlight__on-this-page--mobile" class="astro-doynk5tl"> <details id="starlight__mobile-toc" class="astro-doynk5tl"> <summary id="starlight__on-this-page--mobile" class="sl-flex astro-doynk5tl"> <div class="toggle sl-flex astro-doynk5tl"> On this page <svg aria-hidden="true" class="caret astro-doynk5tl astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1rem;"> <path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z" /> </svg> </div><span class="display-current astro-doynk5tl"></span></summary> <div class="dropdown astro-doynk5tl"> <ul class="isMobile astro-g2bywc46" style="--depth: 0;"> <li class="astro-g2bywc46" style="--depth: 0;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#_top" class="astro-g2bywc46" style="--depth: 0;"> <span class="astro-g2bywc46" style="--depth: 0;">Overview</span> </a></li> <li class="astro-g2bywc46" style="--depth: 0;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#producer" class="astro-g2bywc46" style="--depth: 0;"> <span class="astro-g2bywc46" style="--depth: 0;">Producer</span> </a> <ul class="isMobile astro-g2bywc46" style="--depth: 1;"> <li class="astro-g2bywc46" style="--depth: 1;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#queue" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">Queue</span> </a></li> <li class="astro-g2bywc46" style="--depth: 1;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#messagesendrequest" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">MessageSendRequest</span> </a></li> <li class="astro-g2bywc46" style="--depth: 1;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#queuesendoptions" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">QueueSendOptions</span> </a></li> <li class="astro-g2bywc46" style="--depth: 1;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#queuesendbatchoptions" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">QueueSendBatchOptions</span> </a></li> <li class="astro-g2bywc46" style="--depth: 1;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#queuescontenttype" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">QueuesContentType</span> </a></li> </ul></li> <li class="astro-g2bywc46" style="--depth: 0;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#consumer" class="astro-g2bywc46" style="--depth: 0;"> <span class="astro-g2bywc46" style="--depth: 0;">Consumer</span> </a> <ul class="isMobile astro-g2bywc46" style="--depth: 1;"> <li class="astro-g2bywc46" style="--depth: 1;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#messagebatch" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">MessageBatch</span> </a></li> <li class="astro-g2bywc46" style="--depth: 1;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#message" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">Message</span> </a></li> <li class="astro-g2bywc46" style="--depth: 1;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#queueretryoptions" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">QueueRetryOptions</span> </a></li> </ul></li> </ul> </div> </details> </nav> </mobile-starlight-toc> <script type="module" src="/_astro/MobileTableOfContents.astro_astro_type_script_index_0_lang.C181hMzK.js"></script> </div> <div class="right-sidebar-panel sl-hidden lg:sl-block astro-pb3aqygn"> <div class="sl-container astro-pb3aqygn"> <starlight-toc data-min-h="2" data-max-h="3"> <nav aria-labelledby="starlight__on-this-page"> <h2 id="starlight__on-this-page">On this page</h2> <ul class="astro-g2bywc46" style="--depth: 0;"> <li class="astro-g2bywc46" style="--depth: 0;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#_top" class="astro-g2bywc46" style="--depth: 0;"> <span class="astro-g2bywc46" style="--depth: 0;">Overview</span> </a></li> <li class="astro-g2bywc46" style="--depth: 0;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#producer" class="astro-g2bywc46" style="--depth: 0;"> <span class="astro-g2bywc46" style="--depth: 0;">Producer</span> </a> <ul class="astro-g2bywc46" style="--depth: 1;"> <li class="astro-g2bywc46" style="--depth: 1;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#queue" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">Queue</span> </a></li> <li class="astro-g2bywc46" style="--depth: 1;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#messagesendrequest" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">MessageSendRequest</span> </a></li> <li class="astro-g2bywc46" style="--depth: 1;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#queuesendoptions" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">QueueSendOptions</span> </a></li> <li class="astro-g2bywc46" style="--depth: 1;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#queuesendbatchoptions" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">QueueSendBatchOptions</span> </a></li> <li class="astro-g2bywc46" style="--depth: 1;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#queuescontenttype" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">QueuesContentType</span> </a></li> </ul></li> <li class="astro-g2bywc46" style="--depth: 0;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#consumer" class="astro-g2bywc46" style="--depth: 0;"> <span class="astro-g2bywc46" style="--depth: 0;">Consumer</span> </a> <ul class="astro-g2bywc46" style="--depth: 1;"> <li class="astro-g2bywc46" style="--depth: 1;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#messagebatch" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">MessageBatch</span> </a></li> <li class="astro-g2bywc46" style="--depth: 1;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#message" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">Message</span> </a></li> <li class="astro-g2bywc46" style="--depth: 1;"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#queueretryoptions" class="astro-g2bywc46" style="--depth: 1;"> <span class="astro-g2bywc46" style="--depth: 1;">QueueRetryOptions</span> </a></li> </ul></li> </ul> </nav> </starlight-toc> <script type="module" src="/_astro/TableOfContents.astro_astro_type_script_index_0_lang.CKWWgpjV.js"></script><br><feedback-prompt class="not-content astro-x6kpz2mu"> <div id="feedback-thumbs" class="astro-x6kpz2mu"> <h2 class="astro-x6kpz2mu">Was this helpful?</h2> <div class="not-content astro-x6kpz2mu"> <svg width="1em" height="1em" viewbox="0 0 24 24" class="astro-x6kpz2mu" data-icon="material-symbols:thumb-up-outline-rounded"> <title>Yes</title><use href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#ai:material-symbols:thumb-up-outline-rounded"></use> </svg> <svg width="1em" height="1em" viewbox="0 0 24 24" class="astro-x6kpz2mu" data-icon="material-symbols:thumb-down-outline-rounded"> <title>No</title><use href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#ai:material-symbols:thumb-down-outline-rounded"></use> </svg> </div> </div> <div id="feedback-yes" class="hidden astro-x6kpz2mu"> <h2 class="astro-x6kpz2mu">What did you like?</h2> <form class="astro-x6kpz2mu"> <fieldset class="astro-x6kpz2mu"> <div class="astro-x6kpz2mu"><input type="radio" id="accurate" value="accurate" name="reason" class="astro-x6kpz2mu"> <label for="accurate" class="astro-x6kpz2mu">Accurate</label> </div> <div class="astro-x6kpz2mu"><input type="radio" id="easy-to-understand" value="easy-to-understand" name="reason" class="astro-x6kpz2mu"> <label for="easy-to-understand" class="astro-x6kpz2mu">Easy to understand</label> </div> <div class="astro-x6kpz2mu"><input type="radio" id="solved-my-problem" value="solved-my-problem" name="reason" class="astro-x6kpz2mu"> <label for="solved-my-problem" class="astro-x6kpz2mu">Solved my problem</label> </div> <div class="astro-x6kpz2mu"><input type="radio" id="helped-me-decide-to-use-the-product" value="solved-my-problem" name="reason" class="astro-x6kpz2mu"> <label for="helped-me-decide-to-use-the-product" class="astro-x6kpz2mu">Helped me decide to use the product</label> </div> <div class="astro-x6kpz2mu"><input type="radio" id="other" value="other" name="reason" class="astro-x6kpz2mu"> <label for="other" class="astro-x6kpz2mu">Other</label> <input type="text" placeholder="Tell us more about your experience." id="info" name="info" class="astro-x6kpz2mu"> </div><input type="submit" value="Submit" class="astro-x6kpz2mu"> </fieldset> </form> </div> <div id="feedback-no" class="hidden astro-x6kpz2mu"> <h2 class="astro-x6kpz2mu">What went wrong?</h2> <form class="astro-x6kpz2mu"> <fieldset class="astro-x6kpz2mu"> <div class="astro-x6kpz2mu"><input type="radio" id="hard-to-understand" value="hard-to-understand" name="reason" class="astro-x6kpz2mu"> <label for="hard-to-understand" class="astro-x6kpz2mu">Hard to understand</label> </div> <div class="astro-x6kpz2mu"><input type="radio" id="incorrect-information" value="incorrect-information" name="reason" class="astro-x6kpz2mu"> <label for="incorrect-information" class="astro-x6kpz2mu">Incorrect information</label> </div> <div class="astro-x6kpz2mu"><input type="radio" id="missing-the-information" value="missing-the-information" name="reason" class="astro-x6kpz2mu"> <label for="missing-the-information" class="astro-x6kpz2mu">Missing the information</label> </div> <div class="astro-x6kpz2mu"><input type="radio" id="other" value="other" name="reason" class="astro-x6kpz2mu"> <label for="other" class="astro-x6kpz2mu">Other</label> <input type="text" placeholder="Tell us more about your experience." id="info" name="info" class="astro-x6kpz2mu"> </div><input type="submit" value="Submit" class="astro-x6kpz2mu"> </fieldset> </form> </div> <div id="feedback-thanks" class="hidden astro-x6kpz2mu"> <h2 class="astro-x6kpz2mu">Thank you for helping improve Cloudflare's documentation!</h2> </div> </feedback-prompt> </div> </div> </div> </aside> <div class="main-pane astro-67yu43on"> <main data-pagefind-body lang="en" dir="ltr" class="astro-bguv2lll"> <div class="content-panel astro-7nkwcw3z"> <div class="sl-container astro-7nkwcw3z"><astro-breadcrumbs data-main-bem-class="c-breadcrumbs" data-id="breadcrumbs" data-path-length="3" data-truncated> <nav aria-label="breadcrumbs" class="c-breadcrumbs" id="breadcrumbs"> <ol class="c-breadcrumbs__crumbs has-separators"> <li class="c-breadcrumbs__crumb"><a href="https://developers-cloudflare-com.translate.goog/products/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="c-breadcrumbs__link is-index"> Products </a> <span class="c-breadcrumbs__separator" aria-hidden="true"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="astro-couag5ji"> <polyline points="9 18 15 12 9 6" class="astro-couag5ji"></polyline> </svg></span></li> <li class="c-breadcrumbs__crumb has-ellipsis"><button type="button" aria-label="Show hidden navigation" class="c-breadcrumbs__truncated-button"> … </button> <span class="c-breadcrumbs__separator" aria-hidden="true"> </span></li> <li class="c-breadcrumbs__crumb"><a href="https://developers-cloudflare-com.translate.goog/queues/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="c-breadcrumbs__link"> Queues </a> <span class="c-breadcrumbs__separator" aria-hidden="true"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="astro-couag5ji"> <polyline points="9 18 15 12 9 6" class="astro-couag5ji"></polyline> </svg></span></li> <li class="c-breadcrumbs__crumb"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="c-breadcrumbs__link"> Configuration </a> <span class="c-breadcrumbs__separator" aria-hidden="true"> <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewbox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="astro-couag5ji"> <polyline points="9 18 15 12 9 6" class="astro-couag5ji"></polyline> </svg></span></li> <li class="c-breadcrumbs__crumb"><a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="c-breadcrumbs__link is-current" aria-current="location"> JavaScript APIs </a></li> </ol> </nav> </astro-breadcrumbs> <script type="application/ld+json">{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"/products/","name":"Products"}},{"@type":"ListItem","position":2,"item":{"@id":"/queues/","name":"Queues"}},{"@type":"ListItem","position":3,"item":{"@id":"/queues/configuration/","name":"Configuration"}},{"@type":"ListItem","position":4,"item":{"@id":"/queues/configuration/javascript-apis/","name":"JavaScript APIs"}}]}</script> <script type="module">class t extends HTMLElement{constructor(){super(),this.isManualToggle=!1,this.breadcrumbs=null,this.mainBemClass=null,this.totalWidth=0,this.resizeObserver=null,this.handleTruncatedButtonClick=()=>{this.breadcrumbs?.classList.remove("is-truncated"),this.isManualToggle=!0},this.mainBemClass=this.dataset.mainBemClass||null;const e=this.dataset.id;!("truncated"in this.dataset)||!e||(this.breadcrumbs=document.getElementById(e),this.initializeCrumbs(),this.setupResizeObserver())}initializeCrumbs(){this.breadcrumbs?.querySelectorAll(`.${this.mainBemClass}__crumb`)?.forEach(s=>{this.totalWidth+=s.offsetWidth})}setupResizeObserver(){this.resizeObserver=new ResizeObserver(e=>{e.forEach(s=>{this.checkOverflow(s.target.clientWidth)})}),this.breadcrumbs&&this.resizeObserver.observe(this.breadcrumbs)}connectedCallback(){this.showHiddenCrumbs()}disconnectedCallback(){this.resizeObserver&&this.breadcrumbs&&(this.resizeObserver.unobserve(this.breadcrumbs),this.resizeObserver.disconnect())}toggleTruncated(e){this.breadcrumbs?.classList.toggle("is-truncated",e)}showHiddenCrumbs(){const e=this.breadcrumbs?.querySelector(`.${this.mainBemClass}__truncated-button`);e?.removeEventListener("click",this.handleTruncatedButtonClick),e?.addEventListener("click",this.handleTruncatedButtonClick.bind(this))}checkOverflow(e){const s=this.totalWidth>e&&!this.isManualToggle;this.toggleTruncated(s),s||(this.isManualToggle=!1)}}customElements.get("astro-breadcrumbs")||customElements.define("astro-breadcrumbs",t);</script> <h1 id="_top" class="astro-j6tvhyss">JavaScript APIs</h1> </div> </div> <div class="content-panel astro-7nkwcw3z"> <div class="sl-container astro-7nkwcw3z"><starlight-image-zoom class="astro-vjux6bgf"> <template class="astro-vjux6bgf"><dialog class="starlight-image-zoom-dialog astro-vjux6bgf"> <button aria-label="Unzoom image" class="starlight-image-zoom-control astro-vjux6bgf"> <svg aria-hidden="true" fill="currentColor" viewbox="0 0 24 24" class="astro-vjux6bgf"><use href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#starlight-image-zoom-icon-unzoom" class="astro-vjux6bgf"></use> </svg></button> <figure class="astro-vjux6bgf"></figure> </dialog> </template> <svg xmlns="http://www.w3.org/2000/svg" style="display:none" class="astro-vjux6bgf"><symbol id="starlight-image-zoom-icon-zoom" viewbox="0 0 24 24" class="astro-vjux6bgf"> <path d="M9.79 12.79 4 18.59V17a1 1 0 0 0-2 0v4a1 1 0 0 0 .08.38 1 1 0 0 0 .54.54A1 1 0 0 0 3 22h4a1 1 0 0 0 0-2H5.41l5.8-5.79a1 1 0 0 0-1.42-1.42ZM21.92 2.62a1 1 0 0 0-.54-.54A1 1 0 0 0 21 2h-4a1 1 0 0 0 0 2h1.59l-5.8 5.79a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0L20 5.41V7a1 1 0 0 0 2 0V3a1 1 0 0 0-.08-.38Z" class="astro-vjux6bgf" /> </symbol> <symbol id="starlight-image-zoom-icon-unzoom" viewbox="0 0 24 24" class="astro-vjux6bgf"> <path d="M21.71 2.29a1 1 0 0 0-1.42 0l-5.79 5.8V6.5a1 1 0 0 0-2 0v4a1 1 0 0 0 .08.38 1 1 0 0 0 .54.54 1 1 0 0 0 .38.08h4a1 1 0 0 0 0-2h-1.59l5.8-5.79a1 1 0 0 0 0-1.42ZM10.88 12.58a1 1 0 0 0-.38-.08h-4a1 1 0 0 0 0 2h1.59l-5.8 5.79a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0l5.79-5.8v1.59a1 1 0 0 0 2 0v-4a1 1 0 0 0-.08-.38 1 1 0 0 0-.54-.54Z" class="astro-vjux6bgf" /> </symbol> </svg> </starlight-image-zoom> <script type="module">const L="starlight-image-zoom-zoomable",w=window.requestIdleCallback??(y=>setTimeout(y,1));customElements.define("starlight-image-zoom",class f extends HTMLElement{#t;#i=[];#o;#s=this.querySelector("template");#e={image:"starlight-image-zoom-image",opened:"starlight-image-zoom-opened",source:"starlight-image-zoom-source",transition:"starlight-image-zoom-transition"};#r="zoomTransform";static#u=!1;constructor(){super();const t=()=>{w(()=>{const e=[...document.querySelectorAll(L)];e.length!==0&&(this.#m(e),document.addEventListener("click",this.#d),window.addEventListener("resize",this.#a))})};window.addEventListener("DOMContentLoaded",t,{once:!0}),document.addEventListener("astro:after-preparation",()=>{document.removeEventListener("click",this.#d),window.removeEventListener("resize",this.#a)},{once:!0}),f.#u||=document.addEventListener("astro:after-swap",t)===void 0}#m(t){for(const e of t){const n=e.querySelector("img");n&&(this.#i.push(n),e.querySelector("button")?.addEventListener("click",i=>{i.stopPropagation(),this.#l(n)}))}}#d=({target:t})=>{if(!(t instanceof HTMLElement&&t.closest("figcaption"))){if(this.#t){this.#n();return}t instanceof HTMLImageElement&&this.#i.includes(t)&&this.#l(t)}};#a=()=>{this.#n(!0)};#c=()=>{this.#n()};#p=t=>{t.preventDefault(),this.#n()};#l(t){if(!this.#s||this.#t)return;this.#o=document.activeElement;const e=document.createElement("div");e.append(this.#s.content.cloneNode(!0));const n=e.querySelector("dialog"),i=n?.querySelector("figure");if(!n||!i)return;const r={overflow:document.body.style.overflow,width:document.body.style.width},d=document.body.clientWidth;document.body.style.overflow="hidden",document.body.style.width=`${d}px`,document.querySelector("header")?.style.setProperty("padding-inline-end",`calc(var(--sl-nav-pad-x) + ${window.innerWidth-d}px)`);const s=this.#f(t);t.classList.add(this.#e.source),s.classList.add(this.#e.image),i.append(s),this.#w(t.getAttribute("alt"),i),document.body.append(e),document.addEventListener("wheel",this.#c,{once:!0}),n.addEventListener("cancel",this.#p),n.showModal(),w(()=>{s.style.transform="",document.body.classList.add(this.#e.opened)}),this.#t={body:r,dialog:n,image:t,zoomedImage:s}}#n(t=!1){if(window.removeEventListener("wheel",this.#c),!this.#t)return;const{zoomedImage:e}=this.#t;e.style.transform=e.dataset[this.#r]??"",document.body.classList.add(this.#e.transition),document.body.classList.remove(this.#e.opened);const{matches:n}=window.matchMedia("(prefers-reduced-motion: reduce)");t||n?this.#h():e.addEventListener("transitionend",this.#h,{once:!0})}#h=()=>{if(!this.#t)return;const{dialog:t,image:e}=this.#t;document.body.classList.remove(this.#e.transition),e.classList.remove(this.#e.source),t.parentElement?.remove(),document.body.style.overflow=this.#t.body.overflow,document.body.style.width=this.#t.body.width,document.querySelector("header")?.style.setProperty("padding-inline-end","var(--sl-nav-pad-x)"),this.#t=void 0,this.#o instanceof HTMLElement&&this.#o.focus()};#w(t,e){if(Object.hasOwn(this.dataset,"hideCaption")||(t=t?.trim()??"",t.length===0))return;const n=document.createElement("figcaption");n.ariaHidden="true",n.textContent=t,e.append(n)}#f(t){const e=t.getBoundingClientRect(),n=this.#y(t),i=n?window.innerWidth:t.naturalWidth,r=n?window.innerHeight:t.naturalHeight,d=Math.min(window.innerWidth,i),s=Math.min(window.innerHeight,r),l=Math.min(d/i,s/r),a=(n?window.innerWidth:t.naturalWidth)*l,c=(n?window.innerHeight:t.naturalHeight)*l,h=(window.innerHeight-c)/2,u=(window.innerWidth-a)/2,o=t.cloneNode(!0);o.removeAttribute("id"),o.style.position="absolute",o.style.width=`${a}px`,o.style.height=`${c}px`,o.style.top=`${h}px`,o.style.left=`${u}px`,o.style.transform="";const m=e.width/a,p=e.height/c,g=(-u+(e.width-a)/2+e.left)/m,v=(-h+(e.height-c)/2+e.top)/p;return o.style.transform=`scale(${m}, ${p}) translate3d(${g}px, ${v}px, 0)`,o.dataset[this.#r]=o.style.transform,t.parentElement?.tagName==="PICTURE"&&t.currentSrc&&(o.src=t.currentSrc),o}#y(t){return t.currentSrc.toLowerCase().endsWith(".svg")}});</script> <div class="sl-markdown-content astro-cedpceuv"> <p>Cloudflare Queues is integrated with <a href="https://developers-cloudflare-com.translate.goog/workers?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB">Cloudflare Workers</a>. To send and receive messages, you must use a Worker.</p> <p>A Worker that can send messages to a Queue is a producer Worker, while a Worker that can receive messages from a Queue is a consumer Worker. It is possible for the same Worker to be a producer and consumer, if desired.</p> <p>In the future, we expect to support other APIs, such as HTTP endpoints to send or receive messages. To report bugs or request features, go to the <a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://community.cloudflare.com/c/developers/workers/40" target="_blank" rel="noopener">Cloudflare Community Forums<span> ↗</span></a>. To give feedback, go to the <a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://discord.cloudflare.com" target="_blank" rel="noopener"><code dir="auto">#queues</code><span> ↗</span></a> Discord channel.</p> <div tabindex="-1" class="heading-wrapper level-h2"> <h2 id="producer">Producer</h2><a class="anchor-link" href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#producer"><span aria-hidden="true" class="anchor-icon"> <svg width="16" height="16" viewbox="0 0 24 24"> <path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z" /> </svg></span></a> </div> <p>These APIs allow a producer Worker to send messages to a Queue.</p> <p>An example of writing a single message to a Queue:</p> <div class="expressive-code"> <link rel="stylesheet" href="/_astro/ec.jmw5e.css"> <script type="module" src="/_astro/ec.8zarh.js"></script> <figure class="frame not-content"> <figcaption class="header"></figcaption> <pre data-language="ts"><code> <div class="ec-line"> <div class="code"> <span style="--0:#EE9080;--1:#8F1500">type</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">Environment</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#EE9080;--1:#8F1500">=</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#89DDFF;--1:#007474">{</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#EE9080;--1:#8F1500">readonly</span><span style="--0:#EEFFFF;--1:#62676A"> MY_QUEUE</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">Queue</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div> <div class="ec-line"> <div class="code"> <span style="--0:#89DDFF;--1:#007474">};</span> </div> </div> <div class="ec-line"> <div class="code"> </div> </div> <div class="ec-line"> <div class="code"> <span style="--0:#EE9080;--1:#8F1500">export</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#EE9080;--1:#8F1500">default</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#89DDFF;--1:#007474">{</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#EE9080;--1:#8F1500">async</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">fetch</span><span style="--0:#89DDFF;--1:#007474">(</span><span style="--0:#B59EE1;--1:#7C008F">req</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">Request</span><span style="--0:#89DDFF;--1:#007474">,</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#B59EE1;--1:#7C008F">env</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">Environment</span><span style="--0:#89DDFF;--1:#007474">)</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">Promise</span><span style="--0:#89DDFF;--1:#007474"><</span><span style="--0:#57C78F;--1:#00783C">Response</span><span style="--0:#89DDFF;--1:#007474">></span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#89DDFF;--1:#007474">{</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#EE9080;--1:#8F1500">await</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#EEFFFF;--1:#00268F">env</span><span style="--0:#89DDFF;--1:#007474">.</span><span style="--0:#EEFFFF;--1:#00268F">MY_QUEUE</span><span style="--0:#89DDFF;--1:#007474">.</span><span style="--0:#57C78F;--1:#00783C">send</span><span style="--0:#EEFFFF;--1:#62676A">(</span><span style="--0:#89DDFF;--1:#007474">{</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"><span style="--0:#EEFFFF;--1:#62676A"> </span></span><span style="--0:#EEFFFF;--1:#62676A">url</span><span style="--0:#89DDFF;--1:#007474">:</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#EEFFFF;--1:#00268F">req</span><span style="--0:#89DDFF;--1:#007474">.</span><span style="--0:#EEFFFF;--1:#00268F">url</span><span style="--0:#89DDFF;--1:#007474">,</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"><span style="--0:#EEFFFF;--1:#62676A"> </span></span><span style="--0:#EEFFFF;--1:#62676A">method</span><span style="--0:#89DDFF;--1:#007474">:</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#EEFFFF;--1:#00268F">req</span><span style="--0:#89DDFF;--1:#007474">.</span><span style="--0:#EEFFFF;--1:#00268F">method</span><span style="--0:#89DDFF;--1:#007474">,</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"><span style="--0:#EEFFFF;--1:#62676A"> </span></span><span style="--0:#EEFFFF;--1:#62676A">headers</span><span style="--0:#89DDFF;--1:#007474">:</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#EEFFFF;--1:#00268F">Object</span><span style="--0:#89DDFF;--1:#007474">.</span><span style="--0:#57C78F;--1:#00783C">fromEntries</span><span style="--0:#EEFFFF;--1:#62676A">(</span><span style="--0:#EEFFFF;--1:#00268F">req</span><span style="--0:#89DDFF;--1:#007474">.</span><span style="--0:#EEFFFF;--1:#00268F">headers</span><span style="--0:#EEFFFF;--1:#62676A">)</span><span style="--0:#89DDFF;--1:#007474">,</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#89DDFF;--1:#007474">}</span><span style="--0:#EEFFFF;--1:#62676A">)</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#EE9080;--1:#8F1500">return</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#EE9080;--1:#8F1500">new</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">Response</span><span style="--0:#EEFFFF;--1:#62676A">(</span><span style="--0:#FDDA68;--1:#A84E00">'Sent!'</span><span style="--0:#EEFFFF;--1:#62676A">)</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#89DDFF;--1:#007474">},</span> </div> </div> <div class="ec-line"> <div class="code"> <span style="--0:#89DDFF;--1:#007474">};</span> </div> </div></code></pre> <div class="copy"> <button title="Copy to clipboard" data-copied="Copied!" data-code="type Environment = { readonly MY_QUEUE: Queue;};export default { async fetch(req: Request, env: Environment): Promise<Response> { await env.MY_QUEUE.send({ url: req.url, method: req.method, headers: Object.fromEntries(req.headers), }); return new Response('Sent!'); },};"> <div></div></button> </div> </figure> </div> <p>The Queues API also supports writing multiple messages at once:</p> <div class="expressive-code"> <figure class="frame not-content"> <figcaption class="header"></figcaption> <pre data-language="ts"><code> <div class="ec-line"> <div class="code"> <span style="--0:#EE9080;--1:#8F1500">const</span><span style="--0:#EE9080;--1:#32008F"> </span><span style="--0:#57C78F;--1:#00783C">sendResultsToQueue</span><span style="--0:#EE9080;--1:#32008F"> </span><span style="--0:#EE9080;--1:#8F1500">=</span><span style="--0:#EE9080;--1:#32008F"> </span><span style="--0:#EE9080;--1:#8F1500">async</span><span style="--0:#EE9080;--1:#32008F"> </span><span style="--0:#89DDFF;--1:#007474">(</span><span style="--0:#B59EE1;--1:#7C008F">results</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EE9080;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">Array</span><span style="--0:#89DDFF;--1:#007474"><</span><span style="--0:#57C78F;--1:#00783C">any</span><span style="--0:#89DDFF;--1:#007474">>,</span><span style="--0:#EE9080;--1:#32008F"> </span><span style="--0:#B59EE1;--1:#7C008F">env</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EE9080;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">Environment</span><span style="--0:#89DDFF;--1:#007474">)</span><span style="--0:#EE9080;--1:#32008F"> </span><span style="--0:#EE9080;--1:#8F1500">=></span><span style="--0:#EE9080;--1:#32008F"> </span><span style="--0:#89DDFF;--1:#007474">{</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"><span style="--0:#EE9080"> </span></span><span style="--0:#EE9080;--1:#8F1500">const</span><span style="--0:#EE9080;--1:#32008F"> </span><span style="--0:#EEFFFF;--1:#00268F">batch</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EE9080;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">MessageSendRequest</span><span style="--0:#EE9080;--1:#007474">[] </span><span style="--0:#EE9080;--1:#8F1500">=</span><span style="--0:#EE9080;--1:#32008F"> </span><span style="--0:#EEFFFF;--1:#00268F">results</span><span style="--0:#89DDFF;--1:#007474">.</span><span style="--0:#57C78F;--1:#00783C">map</span><span style="--0:#EE9080;--1:#32008F">(</span><span style="--0:#89DDFF;--1:#007474">(</span><span style="--0:#B59EE1;--1:#7C008F">value</span><span style="--0:#89DDFF;--1:#007474">)</span><span style="--0:#EE9080;--1:#32008F"> </span><span style="--0:#EE9080;--1:#8F1500">=></span><span style="--0:#EE9080;--1:#32008F"> (</span><span style="--0:#89DDFF;--1:#007474">{</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"><span style="--0:#EE9080;--1:#32008F"> </span></span><span style="--0:#EE9080;--1:#32008F">body</span><span style="--0:#89DDFF;--1:#007474">:</span><span style="--0:#EE9080;--1:#32008F"> </span><span style="--0:#EEFFFF;--1:#00268F">JSON</span><span style="--0:#89DDFF;--1:#007474">.</span><span style="--0:#57C78F;--1:#00783C">stringify</span><span style="--0:#EE9080;--1:#32008F">(</span><span style="--0:#D5D7D8;--1:#8F1500">value</span><span style="--0:#EE9080;--1:#32008F">)</span><span style="--0:#89DDFF;--1:#007474">,</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#89DDFF;--1:#007474">}</span><span style="--0:#EE9080;--1:#32008F">))</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"><span style="--0:#EE9080"> </span></span><span style="--0:#EE9080;--1:#8F1500">await</span><span style="--0:#EE9080;--1:#32008F"> </span><span style="--0:#EEFFFF;--1:#00268F">env</span><span style="--0:#89DDFF;--1:#007474">.</span><span style="--0:#EEFFFF;--1:#00268F">queue</span><span style="--0:#89DDFF;--1:#007474">.</span><span style="--0:#57C78F;--1:#00783C">sendBatch</span><span style="--0:#EE9080;--1:#32008F">(</span><span style="--0:#D5D7D8;--1:#8F1500">batch</span><span style="--0:#EE9080;--1:#32008F">)</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div> <div class="ec-line"> <div class="code"> <span style="--0:#89DDFF;--1:#007474">};</span> </div> </div></code></pre> <div class="copy"> <button title="Copy to clipboard" data-copied="Copied!" data-code="const sendResultsToQueue = async (results: Array<any>, env: Environment) => { const batch: MessageSendRequest[] = results.map((value) => ({ body: JSON.stringify(value), })); await env.queue.sendBatch(batch);};"> <div></div></button> </div> </figure> </div> <div tabindex="-1" class="heading-wrapper level-h3"> <h3 id="queue"><code dir="auto">Queue</code></h3><a class="anchor-link" href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#queue"><span aria-hidden="true" class="anchor-icon"> <svg width="16" height="16" viewbox="0 0 24 24"> <path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z" /> </svg></span></a> </div> <p>A binding that allows a producer to send messages to a Queue.</p> <div class="expressive-code"> <figure class="frame not-content"> <figcaption class="header"></figcaption> <pre data-language="ts"><code> <div class="ec-line"> <div class="code"> <span style="--0:#EE9080;--1:#8F1500">interface</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">Queue</span><span style="--0:#89DDFF;--1:#007474"><</span><span style="--0:#57C78F;--1:#00783C">Body</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#EE9080;--1:#8F1500">=</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">unknown</span><span style="--0:#89DDFF;--1:#007474">></span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#89DDFF;--1:#007474">{</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#57C78F;--1:#00783C">send</span><span style="--0:#89DDFF;--1:#007474">(</span><span style="--0:#B59EE1;--1:#7C008F">body</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">Body</span><span style="--0:#89DDFF;--1:#007474">,</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#B59EE1;--1:#7C008F">options</span><span style="--0:#EE9080;--1:#8F1500">?:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">QueueSendOptions</span><span style="--0:#89DDFF;--1:#007474">)</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">Promise</span><span style="--0:#89DDFF;--1:#007474"><</span><span style="--0:#57C78F;--1:#00783C">void</span><span style="--0:#89DDFF;--1:#007474">>;</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#57C78F;--1:#00783C">sendBatch</span><span style="--0:#89DDFF;--1:#007474">(</span><span style="--0:#B59EE1;--1:#7C008F">messages</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">Iterable</span><span style="--0:#89DDFF;--1:#007474"><</span><span style="--0:#57C78F;--1:#00783C">MessageSendRequest</span><span style="--0:#89DDFF;--1:#007474"><</span><span style="--0:#57C78F;--1:#00783C">Body</span><span style="--0:#89DDFF;--1:#007474">>>,</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#B59EE1;--1:#7C008F">options</span><span style="--0:#EE9080;--1:#8F1500">?:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">QueueSendBatchOptions</span><span style="--0:#89DDFF;--1:#007474">)</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">Promise</span><span style="--0:#89DDFF;--1:#007474"><</span><span style="--0:#57C78F;--1:#00783C">void</span><span style="--0:#89DDFF;--1:#007474">>;</span> </div> </div> <div class="ec-line"> <div class="code"> <span style="--0:#89DDFF;--1:#007474">}</span> </div> </div></code></pre> <div class="copy"> <button title="Copy to clipboard" data-copied="Copied!" data-code="interface Queue<Body = unknown> { send(body: Body, options?: QueueSendOptions): Promise<void>; sendBatch(messages: Iterable<MessageSendRequest<Body>>, options?: QueueSendBatchOptions): Promise<void>;}"> <div></div></button> </div> </figure> </div> <ul> <li><p><code dir="auto">send(bodyunknown, options?{ contentType?: QueuesContentType })</code>: <code dir="auto">Promise<void></code></p> <ul> <li>Sends a message to the Queue. The body can be any type supported by the <a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm%23supported_types" target="_blank" rel="noopener">structured clone algorithm<span> ↗</span></a>, as long as its size is less than 128 KB.</li> <li>When the promise resolves, the message is confirmed to be written to disk.</li> </ul></li> <li><p><code dir="auto">sendBatch(bodyIterable<MessageSendRequest<unknown>>)</code>: <code dir="auto">Promise<void></code></p> <ul> <li>Sends a batch of messages to the Queue. Each item in the provided <a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://www.typescriptlang.org/docs/handbook/iterators-and-generators.html" target="_blank" rel="noopener">Iterable<span> ↗</span></a> must be supported by the <a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm%23supported_types" target="_blank" rel="noopener">structured clone algorithm<span> ↗</span></a>. A batch can contain up to 100 messages, though items are limited to 128 KB each, and the total size of the array cannot exceed 256 KB.</li> <li>When the promise resolves, the messages are confirmed to be written to disk.</li> </ul></li> </ul> <div tabindex="-1" class="heading-wrapper level-h3"> <h3 id="messagesendrequest"><code dir="auto">MessageSendRequest</code></h3><a class="anchor-link" href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#messagesendrequest"><span aria-hidden="true" class="anchor-icon"> <svg width="16" height="16" viewbox="0 0 24 24"> <path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z" /> </svg></span></a> </div> <p>A wrapper type used for sending message batches.</p> <div class="expressive-code"> <figure class="frame not-content"> <figcaption class="header"></figcaption> <pre data-language="ts"><code> <div class="ec-line"> <div class="code"> <span style="--0:#EE9080;--1:#8F1500">type</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">MessageSendRequest</span><span style="--0:#89DDFF;--1:#007474"><</span><span style="--0:#57C78F;--1:#00783C">Body</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#EE9080;--1:#8F1500">=</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">unknown</span><span style="--0:#89DDFF;--1:#007474">></span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#EE9080;--1:#8F1500">=</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#89DDFF;--1:#007474">{</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"><span style="--0:#EEFFFF;--1:#62676A"> </span></span><span style="--0:#EEFFFF;--1:#62676A">body</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">Body</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"><span style="--0:#EEFFFF;--1:#62676A"> </span></span><span style="--0:#EEFFFF;--1:#62676A">options</span><span style="--0:#EE9080;--1:#8F1500">?:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">QueueSendOptions</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div> <div class="ec-line"> <div class="code"> <span style="--0:#89DDFF;--1:#007474">};</span> </div> </div></code></pre> <div class="copy"> <button title="Copy to clipboard" data-copied="Copied!" data-code="type MessageSendRequest<Body = unknown> = { body: Body; options?: QueueSendOptions;};"> <div></div></button> </div> </figure> </div> <ul> <li><p><code>body</code> unknown</p> <ul> <li>The body of the message.</li> <li>The body can be any type supported by the <a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm%23supported_types" target="_blank" rel="noopener">structured clone algorithm<span> ↗</span></a>, as long as its size is less than 128 KB.</li> </ul></li> <li><code>optionsQueueSendOptions</code> <ul> <li>Options to apply to the current message, including content type and message delay settings.</li> </ul></li> </ul> <div tabindex="-1" class="heading-wrapper level-h3"> <h3 id="queuesendoptions"><code dir="auto">QueueSendOptions</code></h3><a class="anchor-link" href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#queuesendoptions"><span aria-hidden="true" class="anchor-icon"> <svg width="16" height="16" viewbox="0 0 24 24"> <path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z" /> </svg></span></a> </div> <p>Optional configuration that applies when sending a message to a queue.</p> <ul> <li><code>contentTypeQueuesContentType</code> <ul> <li>The explicit content type of a message so it can be previewed correctly with the <a href="https://developers-cloudflare-com.translate.goog/queues/examples/list-messages-from-dash/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB">List messages from the dashboard</a> feature. Optional argument.</li> <li>As of now, this option is for internal use. In the future, <code dir="auto">contentType</code> will be used by alternative consumer types to explicitly mark messages as serialized so they can be consumed in the desired type.</li> <li>See <a href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#queuescontenttype">QueuesContentType</a> for possible values.</li> </ul></li> <li><code>delaySecondsnumber</code> <ul> <li>The number of seconds to <a href="https://developers-cloudflare-com.translate.goog/queues/configuration/batching-retries/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB">delay a message</a> for within the queue, before it can be delivered to a consumer.</li> <li>Must be an integer between 0 and 43200 (12 hours). Setting this value to zero will explicitly prevent the message from being delayed, even if there is a global (default) delay at the queue level.</li> </ul></li> </ul> <div tabindex="-1" class="heading-wrapper level-h3"> <h3 id="queuesendbatchoptions"><code dir="auto">QueueSendBatchOptions</code></h3><a class="anchor-link" href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#queuesendbatchoptions"><span aria-hidden="true" class="anchor-icon"> <svg width="16" height="16" viewbox="0 0 24 24"> <path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z" /> </svg></span></a> </div> <p>Optional configuration that applies when sending a batch of messages to a queue.</p> <ul> <li><code>delaySecondsnumber</code> <ul> <li>The number of seconds to <a href="https://developers-cloudflare-com.translate.goog/queues/configuration/batching-retries/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB">delay messages</a> for within the queue, before it can be delivered to a consumer.</li> <li>Must be a positive integer.</li> </ul></li> </ul> <div tabindex="-1" class="heading-wrapper level-h3"> <h3 id="queuescontenttype"><code dir="auto">QueuesContentType</code></h3><a class="anchor-link" href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#queuescontenttype"><span aria-hidden="true" class="anchor-icon"> <svg width="16" height="16" viewbox="0 0 24 24"> <path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z" /> </svg></span></a> </div> <p>A union type containing valid message content types.</p> <div class="expressive-code"> <figure class="frame not-content"> <figcaption class="header"></figcaption> <pre data-language="ts"><code> <div class="ec-line"> <div class="code"> <span style="--0:#A9A9A5;--0fs:italic;--1:#62676A;--1fs:italic">// Default: json</span> </div> </div> <div class="ec-line"> <div class="code"> <span style="--0:#EE9080;--1:#8F1500">type</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">QueuesContentType</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#EE9080;--1:#8F1500">=</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#FDDA68;--1:#A84E00">"text"</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#EE9080;--1:#8F1500">|</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#FDDA68;--1:#A84E00">"bytes"</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#EE9080;--1:#8F1500">|</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#FDDA68;--1:#A84E00">"json"</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#EE9080;--1:#8F1500">|</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#FDDA68;--1:#A84E00">"v8"</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div></code></pre> <div class="copy"> <button title="Copy to clipboard" data-copied="Copied!" data-code="// Default: jsontype QueuesContentType = "text" | "bytes" | "json" | "v8";"> <div></div></button> </div> </figure> </div> <ul> <li>Use <code dir="auto">"json"</code> to send a JavaScript object that can be JSON-serialized. This content type can be previewed from the <a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://dash.cloudflare.com" target="_blank" rel="noopener">Cloudflare dashboard<span> ↗</span></a>. The <code dir="auto">json</code> content type is the default.</li> <li>Use <code dir="auto">"text"</code> to send a <code dir="auto">String</code>. This content type can be previewed with the <a href="https://developers-cloudflare-com.translate.goog/queues/examples/list-messages-from-dash/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB">List messages from the dashboard</a> feature.</li> <li>Use <code dir="auto">"bytes"</code> to send an <code dir="auto">ArrayBuffer</code>. This content type cannot be previewed from the <a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://dash.cloudflare.com" target="_blank" rel="noopener">Cloudflare dashboard<span> ↗</span></a> and will display as Base64-encoded.</li> <li>Use <code dir="auto">"v8"</code> to send a JavaScript object that cannot be JSON-serialized but is supported by <a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm%23supported_types" target="_blank" rel="noopener">structured clone<span> ↗</span></a> (for example <code dir="auto">Date</code> and <code dir="auto">Map</code>). This content type cannot be previewed from the <a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://dash.cloudflare.com" target="_blank" rel="noopener">Cloudflare dashboard<span> ↗</span></a> and will display as Base64-encoded.</li> </ul> <aside aria-label="Note" class="starlight-aside starlight-aside--note"> <p class="starlight-aside__title" aria-hidden="true"> <svg viewbox="0 0 24 24" width="16" height="16" fill="currentColor" class="starlight-aside__icon"> <path d="M12 11C11.7348 11 11.4804 11.1054 11.2929 11.2929C11.1054 11.4804 11 11.7348 11 12V16C11 16.2652 11.1054 16.5196 11.2929 16.7071C11.4804 16.8946 11.7348 17 12 17C12.2652 17 12.5196 16.8946 12.7071 16.7071C12.8946 16.5196 13 16.2652 13 16V12C13 11.7348 12.8946 11.4804 12.7071 11.2929C12.5196 11.1054 12.2652 11 12 11ZM12.38 7.08C12.1365 6.97998 11.8635 6.97998 11.62 7.08C11.4973 7.12759 11.3851 7.19896 11.29 7.29C11.2017 7.3872 11.1306 7.49882 11.08 7.62C11.024 7.73868 10.9966 7.86882 11 8C10.9992 8.13161 11.0245 8.26207 11.0742 8.38391C11.124 8.50574 11.1973 8.61656 11.29 8.71C11.3872 8.79833 11.4988 8.86936 11.62 8.92C11.7715 8.98224 11.936 9.00632 12.099 8.99011C12.2619 8.97391 12.4184 8.91792 12.5547 8.82707C12.691 8.73622 12.8029 8.61328 12.8805 8.46907C12.9582 8.32486 12.9992 8.16378 13 8C12.9963 7.73523 12.8927 7.48163 12.71 7.29C12.6149 7.19896 12.5028 7.12759 12.38 7.08ZM12 2C10.0222 2 8.08879 2.58649 6.4443 3.6853C4.79981 4.78412 3.51809 6.3459 2.76121 8.17317C2.00433 10.0004 1.8063 12.0111 2.19215 13.9509C2.578 15.8907 3.53041 17.6725 4.92894 19.0711C6.32746 20.4696 8.10929 21.422 10.0491 21.8079C11.9889 22.1937 13.9996 21.9957 15.8268 21.2388C17.6541 20.4819 19.2159 19.2002 20.3147 17.5557C21.4135 15.9112 22 13.9778 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7363 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2ZM12 20C10.4178 20 8.87104 19.5308 7.55544 18.6518C6.23985 17.7727 5.21447 16.5233 4.60897 15.0615C4.00347 13.5997 3.84504 11.9911 4.15372 10.4393C4.4624 8.88743 5.22433 7.46197 6.34315 6.34315C7.46197 5.22433 8.88743 4.4624 10.4393 4.15372C11.9911 3.84504 13.5997 4.00346 15.0615 4.60896C16.5233 5.21447 17.7727 6.23984 18.6518 7.55544C19.5308 8.87103 20 10.4177 20 12C20 14.1217 19.1572 16.1566 17.6569 17.6569C16.1566 19.1571 14.1217 20 12 20Z" /> </svg>Note</p> <div class="starlight-aside__content"> <p>The default content type for Queues changed to <code dir="auto">json</code> (from <code dir="auto">v8</code>) to improve compatibility with pull-based consumers for any Workers with a <a href="https://developers-cloudflare-com.translate.goog/workers/configuration/compatibility-flags/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#queues-send-messages-in-json-format">compatibility date</a> after <code dir="auto">2024-03-18</code>.</p> </div> </aside> <p>If you specify an invalid content type, or if your specified content type does not match the message content's type, the send operation will fail with an error.</p> <div tabindex="-1" class="heading-wrapper level-h2"> <h2 id="consumer">Consumer</h2><a class="anchor-link" href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#consumer"><span aria-hidden="true" class="anchor-icon"> <svg width="16" height="16" viewbox="0 0 24 24"> <path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z" /> </svg></span></a> </div> <p>These APIs allow a consumer Worker to consume messages from a Queue.</p> <p>To define a consumer Worker, add a <code dir="auto">queue()</code> function to the default export of the Worker. This will allow it to receive messages from the Queue.</p> <p>By default, all messages in the batch will be acknowledged as soon as all of the following conditions are met:</p> <ol> <li>The <code dir="auto">queue()</code> function has returned.</li> <li>If the <code dir="auto">queue()</code> function returned a promise, the promise has resolved.</li> <li>Any promises passed to <code dir="auto">waitUntil()</code> have resolved.</li> </ol> <p>If the <code dir="auto">queue()</code> function throws, or the promise returned by it or any of the promises passed to <code dir="auto">waitUntil()</code> were rejected, then the entire batch will be considered a failure and will be retried according to the consumer's retry settings.</p> <aside aria-label="Note" class="starlight-aside starlight-aside--note"> <p class="starlight-aside__title" aria-hidden="true"> <svg viewbox="0 0 24 24" width="16" height="16" fill="currentColor" class="starlight-aside__icon"> <path d="M12 11C11.7348 11 11.4804 11.1054 11.2929 11.2929C11.1054 11.4804 11 11.7348 11 12V16C11 16.2652 11.1054 16.5196 11.2929 16.7071C11.4804 16.8946 11.7348 17 12 17C12.2652 17 12.5196 16.8946 12.7071 16.7071C12.8946 16.5196 13 16.2652 13 16V12C13 11.7348 12.8946 11.4804 12.7071 11.2929C12.5196 11.1054 12.2652 11 12 11ZM12.38 7.08C12.1365 6.97998 11.8635 6.97998 11.62 7.08C11.4973 7.12759 11.3851 7.19896 11.29 7.29C11.2017 7.3872 11.1306 7.49882 11.08 7.62C11.024 7.73868 10.9966 7.86882 11 8C10.9992 8.13161 11.0245 8.26207 11.0742 8.38391C11.124 8.50574 11.1973 8.61656 11.29 8.71C11.3872 8.79833 11.4988 8.86936 11.62 8.92C11.7715 8.98224 11.936 9.00632 12.099 8.99011C12.2619 8.97391 12.4184 8.91792 12.5547 8.82707C12.691 8.73622 12.8029 8.61328 12.8805 8.46907C12.9582 8.32486 12.9992 8.16378 13 8C12.9963 7.73523 12.8927 7.48163 12.71 7.29C12.6149 7.19896 12.5028 7.12759 12.38 7.08ZM12 2C10.0222 2 8.08879 2.58649 6.4443 3.6853C4.79981 4.78412 3.51809 6.3459 2.76121 8.17317C2.00433 10.0004 1.8063 12.0111 2.19215 13.9509C2.578 15.8907 3.53041 17.6725 4.92894 19.0711C6.32746 20.4696 8.10929 21.422 10.0491 21.8079C11.9889 22.1937 13.9996 21.9957 15.8268 21.2388C17.6541 20.4819 19.2159 19.2002 20.3147 17.5557C21.4135 15.9112 22 13.9778 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7363 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2ZM12 20C10.4178 20 8.87104 19.5308 7.55544 18.6518C6.23985 17.7727 5.21447 16.5233 4.60897 15.0615C4.00347 13.5997 3.84504 11.9911 4.15372 10.4393C4.4624 8.88743 5.22433 7.46197 6.34315 6.34315C7.46197 5.22433 8.88743 4.4624 10.4393 4.15372C11.9911 3.84504 13.5997 4.00346 15.0615 4.60896C16.5233 5.21447 17.7727 6.23984 18.6518 7.55544C19.5308 8.87103 20 10.4177 20 12C20 14.1217 19.1572 16.1566 17.6569 17.6569C16.1566 19.1571 14.1217 20 12 20Z" /> </svg>Note</p> <div class="starlight-aside__content"> <p><code dir="auto">waitUntil()</code> is the only supported method to run tasks (such as logging or metrics calls) that resolve after a queue handler has completed. Promises that have not resolved by the time the queue handler returns may not complete and will not block completion of execution.</p> </div> </aside> <div class="expressive-code"> <figure class="frame not-content"> <figcaption class="header"></figcaption> <pre data-language="ts"><code> <div class="ec-line"> <div class="code"> <span style="--0:#EE9080;--1:#8F1500">export</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#EE9080;--1:#8F1500">default</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#89DDFF;--1:#007474">{</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#EE9080;--1:#8F1500">async</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">queue</span><span style="--0:#89DDFF;--1:#007474">(</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#B59EE1;--1:#7C008F">batch</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">MessageBatch</span><span style="--0:#89DDFF;--1:#007474">,</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#B59EE1;--1:#7C008F">env</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">Environment</span><span style="--0:#89DDFF;--1:#007474">,</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#B59EE1;--1:#7C008F">ctx</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">ExecutionContext</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"><span style="--1:#007474"> </span></span><span style="--0:#89DDFF;--1:#007474">)</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">Promise</span><span style="--0:#89DDFF;--1:#007474"><</span><span style="--0:#57C78F;--1:#00783C">void</span><span style="--0:#89DDFF;--1:#007474">></span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#89DDFF;--1:#007474">{</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#EE9080;--1:#8F1500">for</span><span style="--0:#EEFFFF;--1:#62676A"> (</span><span style="--0:#EE9080;--1:#8F1500">const</span><span style="--0:#EE9080;--1:#32008F"> </span><span style="--0:#EEFFFF;--1:#00268F">message</span><span style="--0:#EE9080;--1:#32008F"> </span><span style="--0:#EE9080;--1:#8F1500">of</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#EEFFFF;--1:#00268F">batch</span><span style="--0:#89DDFF;--1:#007474">.</span><span style="--0:#EEFFFF;--1:#00268F">messages</span><span style="--0:#EEFFFF;--1:#62676A">) </span><span style="--0:#89DDFF;--1:#007474">{</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"><span style="--0:#EEFFFF"> </span></span><span style="--0:#EEFFFF;--1:#00268F">console</span><span style="--0:#89DDFF;--1:#007474">.</span><span style="--0:#57C78F;--1:#00783C">log</span><span style="--0:#EEFFFF;--1:#62676A">(</span><span style="--0:#FDDA68;--1:#A84E00">'Received'</span><span style="--0:#89DDFF;--1:#007474">,</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#D5D7D8;--1:#8F1500">message</span><span style="--0:#EEFFFF;--1:#62676A">)</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#89DDFF;--1:#007474">}</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#89DDFF;--1:#007474">},</span> </div> </div> <div class="ec-line"> <div class="code"> <span style="--0:#89DDFF;--1:#007474">};</span> </div> </div></code></pre> <div class="copy"> <button title="Copy to clipboard" data-copied="Copied!" data-code="export default { async queue( batch: MessageBatch, env: Environment, ctx: ExecutionContext ): Promise<void> { for (const message of batch.messages) { console.log('Received', message); } },};"> <div></div></button> </div> </figure> </div> <p>The <code dir="auto">env</code> and <code dir="auto">ctx</code> fields are as <a href="https://developers-cloudflare-com.translate.goog/workers/reference/migrate-to-module-workers/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB">documented in the Workers documentation</a>.</p> <p>Or alternatively, a queue consumer can be written using the (deprecated) service worker syntax:</p> <div class="expressive-code"> <figure class="frame not-content"> <figcaption class="header"></figcaption> <pre data-language="js"><code> <div class="ec-line"> <div class="code"> <span style="--0:#57C78F;--1:#00783C">addEventListener</span><span style="--0:#EEFFFF;--1:#62676A">(</span><span style="--0:#FDDA68;--1:#A84E00">'queue'</span><span style="--0:#89DDFF;--1:#007474">,</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#89DDFF;--1:#007474">(</span><span style="--0:#B59EE1;--1:#7C008F">event</span><span style="--0:#89DDFF;--1:#007474">)</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#EE9080;--1:#8F1500">=></span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#89DDFF;--1:#007474">{</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"><span style="--0:#EEFFFF"> </span></span><span style="--0:#EEFFFF;--1:#00268F">event</span><span style="--0:#89DDFF;--1:#007474">.</span><span style="--0:#57C78F;--1:#00783C">waitUntil</span><span style="--0:#EEFFFF;--1:#62676A">(</span><span style="--0:#57C78F;--1:#00783C">handleMessages</span><span style="--0:#EEFFFF;--1:#62676A">(</span><span style="--0:#D5D7D8;--1:#8F1500">event</span><span style="--0:#EEFFFF;--1:#62676A">))</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div> <div class="ec-line"> <div class="code"> <span style="--0:#89DDFF;--1:#007474">}</span><span style="--0:#EEFFFF;--1:#62676A">)</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div></code></pre> <div class="copy"> <button title="Copy to clipboard" data-copied="Copied!" data-code="addEventListener('queue', (event) => { event.waitUntil(handleMessages(event));});"> <div></div></button> </div> </figure> </div> <p>In service worker syntax, <code dir="auto">event</code> provides the same fields and methods as <code dir="auto">MessageBatch</code>, as defined below, in addition to <a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://developer.mozilla.org/en-US/docs/Web/API/ExtendableEvent/waitUntil" target="_blank" rel="noopener"><code dir="auto">waitUntil()</code><span> ↗</span></a>.</p> <aside aria-label="Note" class="starlight-aside starlight-aside--note"> <p class="starlight-aside__title" aria-hidden="true"> <svg viewbox="0 0 24 24" width="16" height="16" fill="currentColor" class="starlight-aside__icon"> <path d="M12 11C11.7348 11 11.4804 11.1054 11.2929 11.2929C11.1054 11.4804 11 11.7348 11 12V16C11 16.2652 11.1054 16.5196 11.2929 16.7071C11.4804 16.8946 11.7348 17 12 17C12.2652 17 12.5196 16.8946 12.7071 16.7071C12.8946 16.5196 13 16.2652 13 16V12C13 11.7348 12.8946 11.4804 12.7071 11.2929C12.5196 11.1054 12.2652 11 12 11ZM12.38 7.08C12.1365 6.97998 11.8635 6.97998 11.62 7.08C11.4973 7.12759 11.3851 7.19896 11.29 7.29C11.2017 7.3872 11.1306 7.49882 11.08 7.62C11.024 7.73868 10.9966 7.86882 11 8C10.9992 8.13161 11.0245 8.26207 11.0742 8.38391C11.124 8.50574 11.1973 8.61656 11.29 8.71C11.3872 8.79833 11.4988 8.86936 11.62 8.92C11.7715 8.98224 11.936 9.00632 12.099 8.99011C12.2619 8.97391 12.4184 8.91792 12.5547 8.82707C12.691 8.73622 12.8029 8.61328 12.8805 8.46907C12.9582 8.32486 12.9992 8.16378 13 8C12.9963 7.73523 12.8927 7.48163 12.71 7.29C12.6149 7.19896 12.5028 7.12759 12.38 7.08ZM12 2C10.0222 2 8.08879 2.58649 6.4443 3.6853C4.79981 4.78412 3.51809 6.3459 2.76121 8.17317C2.00433 10.0004 1.8063 12.0111 2.19215 13.9509C2.578 15.8907 3.53041 17.6725 4.92894 19.0711C6.32746 20.4696 8.10929 21.422 10.0491 21.8079C11.9889 22.1937 13.9996 21.9957 15.8268 21.2388C17.6541 20.4819 19.2159 19.2002 20.3147 17.5557C21.4135 15.9112 22 13.9778 22 12C22 10.6868 21.7413 9.38642 21.2388 8.17317C20.7363 6.95991 19.9997 5.85752 19.0711 4.92893C18.1425 4.00035 17.0401 3.26375 15.8268 2.7612C14.6136 2.25866 13.3132 2 12 2ZM12 20C10.4178 20 8.87104 19.5308 7.55544 18.6518C6.23985 17.7727 5.21447 16.5233 4.60897 15.0615C4.00347 13.5997 3.84504 11.9911 4.15372 10.4393C4.4624 8.88743 5.22433 7.46197 6.34315 6.34315C7.46197 5.22433 8.88743 4.4624 10.4393 4.15372C11.9911 3.84504 13.5997 4.00346 15.0615 4.60896C16.5233 5.21447 17.7727 6.23984 18.6518 7.55544C19.5308 8.87103 20 10.4177 20 12C20 14.1217 19.1572 16.1566 17.6569 17.6569C16.1566 19.1571 14.1217 20 12 20Z" /> </svg>Note</p> <div class="starlight-aside__content"> <p>When performing asynchronous tasks in your queue handler that iterates through messages, use an asynchronous version of iterating through your messages. For example, <code dir="auto">for (const m of batch.messages)</code>or <code dir="auto">await Promise.all(batch.messages.map(work))</code> allow for waiting for the results of asynchronous calls. <code dir="auto">batch.messages.forEach()</code> does not.</p> </div> </aside> <div tabindex="-1" class="heading-wrapper level-h3"> <h3 id="messagebatch"><code dir="auto">MessageBatch</code></h3><a class="anchor-link" href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#messagebatch"><span aria-hidden="true" class="anchor-icon"> <svg width="16" height="16" viewbox="0 0 24 24"> <path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z" /> </svg></span></a> </div> <p>A batch of messages that are sent to a consumer Worker.</p> <div class="expressive-code"> <figure class="frame not-content"> <figcaption class="header"></figcaption> <pre data-language="ts"><code> <div class="ec-line"> <div class="code"> <span style="--0:#EE9080;--1:#8F1500">interface</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">MessageBatch</span><span style="--0:#89DDFF;--1:#007474"><</span><span style="--0:#57C78F;--1:#00783C">Body</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#EE9080;--1:#8F1500">=</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">unknown</span><span style="--0:#89DDFF;--1:#007474">></span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#89DDFF;--1:#007474">{</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#EE9080;--1:#8F1500">readonly</span><span style="--0:#EEFFFF;--1:#62676A"> queue</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">string</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#EE9080;--1:#8F1500">readonly</span><span style="--0:#EEFFFF;--1:#62676A"> messages</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">Message</span><span style="--0:#89DDFF;--1:#007474"><</span><span style="--0:#57C78F;--1:#00783C">Body</span><span style="--1:#007474"><span style="--0:#89DDFF">></span><span style="--0:#EEFFFF">[]</span><span style="--0:#89DDFF">;</span></span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#57C78F;--1:#00783C">ackAll</span><span style="--0:#89DDFF;--1:#007474">()</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">void</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#57C78F;--1:#00783C">retryAll</span><span style="--0:#89DDFF;--1:#007474">(</span><span style="--0:#B59EE1;--1:#7C008F">options</span><span style="--0:#EE9080;--1:#8F1500">?:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">QueueRetryOptions</span><span style="--0:#89DDFF;--1:#007474">)</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">void</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div> <div class="ec-line"> <div class="code"> <span style="--0:#89DDFF;--1:#007474">}</span> </div> </div></code></pre> <div class="copy"> <button title="Copy to clipboard" data-copied="Copied!" data-code="interface MessageBatch<Body = unknown> { readonly queue: string; readonly messages: Message<Body>[]; ackAll(): void; retryAll(options?: QueueRetryOptions): void;}"> <div></div></button> </div> </figure> </div> <ul> <li><p><code>queue</code> string</p> <ul> <li>The name of the Queue that belongs to this batch.</li> </ul></li> <li><p><code>messages</code> Message[]</p> <ul> <li>An array of messages in the batch. Ordering of messages is best effort -- not guaranteed to be exactly the same as the order in which they were published. If you are interested in guaranteed FIFO ordering, please <a href="mailto:queues@cloudflare.com?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB">email the Queues team</a>.</li> </ul></li> <li><p><code>ackAll()</code> void</p> <ul> <li>Marks every message as successfully delivered, regardless of whether your <code dir="auto">queue()</code> consumer handler returns successfully or not.</li> </ul></li> <li><p><code>retryAll(options?: QueueRetryOptions)</code> void</p> <ul> <li>Marks every message to be retried in the next batch.</li> <li>Supports an optional <code dir="auto">options</code> object.</li> </ul></li> </ul> <div tabindex="-1" class="heading-wrapper level-h3"> <h3 id="message"><code dir="auto">Message</code></h3><a class="anchor-link" href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#message"><span aria-hidden="true" class="anchor-icon"> <svg width="16" height="16" viewbox="0 0 24 24"> <path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z" /> </svg></span></a> </div> <p>A message that is sent to a consumer Worker.</p> <div class="expressive-code"> <figure class="frame not-content"> <figcaption class="header"></figcaption> <pre data-language="ts"><code> <div class="ec-line"> <div class="code"> <span style="--0:#EE9080;--1:#8F1500">interface</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">Message</span><span style="--0:#89DDFF;--1:#007474"><</span><span style="--0:#57C78F;--1:#00783C">Body</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#EE9080;--1:#8F1500">=</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">unknown</span><span style="--0:#89DDFF;--1:#007474">></span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#89DDFF;--1:#007474">{</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#EE9080;--1:#8F1500">readonly</span><span style="--0:#EEFFFF;--1:#62676A"> id</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">string</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#EE9080;--1:#8F1500">readonly</span><span style="--0:#EEFFFF;--1:#62676A"> timestamp</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">Date</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#EE9080;--1:#8F1500">readonly</span><span style="--0:#EEFFFF;--1:#62676A"> body</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">Body</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#EE9080;--1:#8F1500">readonly</span><span style="--0:#EEFFFF;--1:#62676A"> attempts</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">number</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#57C78F;--1:#00783C">ack</span><span style="--0:#89DDFF;--1:#007474">()</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">void</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"> </span><span style="--0:#57C78F;--1:#00783C">retry</span><span style="--0:#89DDFF;--1:#007474">(</span><span style="--0:#B59EE1;--1:#7C008F">options</span><span style="--0:#EE9080;--1:#8F1500">?:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">QueueRetryOptions</span><span style="--0:#89DDFF;--1:#007474">)</span><span style="--0:#EE9080;--1:#8F1500">:</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">void</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div> <div class="ec-line"> <div class="code"> <span style="--0:#89DDFF;--1:#007474">}</span> </div> </div></code></pre> <div class="copy"> <button title="Copy to clipboard" data-copied="Copied!" data-code="interface Message<Body = unknown> { readonly id: string; readonly timestamp: Date; readonly body: Body; readonly attempts: number; ack(): void; retry(options?: QueueRetryOptions): void;}"> <div></div></button> </div> </figure> </div> <ul> <li><p><code>id</code> string</p> <ul> <li>A unique, system-generated ID for the message.</li> </ul></li> <li><p><code>timestamp</code> Date</p> <ul> <li>A timestamp when the message was sent.</li> </ul></li> <li><p><code>body</code> unknown</p> <ul> <li>The body of the message.</li> <li>The body can be any type supported by the <a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm%23supported_types" target="_blank" rel="noopener">structured clone algorithm<span> ↗</span></a>, as long as its size is less than 128 KB.</li> </ul></li> <li><p><code>attempts</code> number</p> <ul> <li>The number of times the consumer has attempted to process this message. Starts at 1.</li> </ul></li> <li><p><code>ack()</code> void</p> <ul> <li>Marks a message as successfully delivered, regardless of whether your <code dir="auto">queue()</code> consumer handler returns successfully or not.</li> </ul></li> <li><p><code>retry(options?: QueueRetryOptions)</code> void</p> <ul> <li>Marks a message to be retried in the next batch.</li> <li>Supports an optional <code dir="auto">options</code> object.</li> </ul></li> </ul> <div tabindex="-1" class="heading-wrapper level-h3"> <h3 id="queueretryoptions"><code dir="auto">QueueRetryOptions</code></h3><a class="anchor-link" href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#queueretryoptions"><span aria-hidden="true" class="anchor-icon"> <svg width="16" height="16" viewbox="0 0 24 24"> <path fill="currentcolor" d="m12.11 15.39-3.88 3.88a2.52 2.52 0 0 1-3.5 0 2.47 2.47 0 0 1 0-3.5l3.88-3.88a1 1 0 0 0-1.42-1.42l-3.88 3.89a4.48 4.48 0 0 0 6.33 6.33l3.89-3.88a1 1 0 1 0-1.42-1.42Zm8.58-12.08a4.49 4.49 0 0 0-6.33 0l-3.89 3.88a1 1 0 0 0 1.42 1.42l3.88-3.88a2.52 2.52 0 0 1 3.5 0 2.47 2.47 0 0 1 0 3.5l-3.88 3.88a1 1 0 1 0 1.42 1.42l3.88-3.89a4.49 4.49 0 0 0 0-6.33ZM8.83 15.17a1 1 0 0 0 1.1.22 1 1 0 0 0 .32-.22l4.92-4.92a1 1 0 0 0-1.42-1.42l-4.92 4.92a1 1 0 0 0 0 1.42Z" /> </svg></span></a> </div> <p>Optional configuration when marking a message or a batch of messages for retry.</p> <div class="expressive-code"> <figure class="frame not-content"> <figcaption class="header"></figcaption> <pre data-language="ts"><code> <div class="ec-line"> <div class="code"> <span style="--0:#EE9080;--1:#8F1500">declare</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#EE9080;--1:#8F1500">interface</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#57C78F;--1:#00783C">QueueRetryOptions</span><span style="--0:#EEFFFF;--1:#62676A"> </span><span style="--0:#89DDFF;--1:#007474">{</span> </div> </div> <div class="ec-line"> <div class="code"> <span class="indent"><span style="--0:#EEFFFF;--1:#62676A"> </span></span><span style="--0:#EEFFFF;--1:#62676A">delaySeconds</span><span style="--0:#EE9080;--1:#8F1500">?:</span><span style="--0:#EEFFFF;--1:#007474"> </span><span style="--0:#57C78F;--1:#00783C">number</span><span style="--0:#89DDFF;--1:#007474">;</span> </div> </div> <div class="ec-line"> <div class="code"> <span style="--0:#89DDFF;--1:#007474">}</span> </div> </div></code></pre> <div class="copy"> <button title="Copy to clipboard" data-copied="Copied!" data-code="declare interface QueueRetryOptions { delaySeconds?: number;}"> <div></div></button> </div> </figure> </div> <ul> <li><code>delaySecondsnumber</code> <ul> <li>The number of seconds to <a href="https://developers-cloudflare-com.translate.goog/queues/configuration/batching-retries/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB">delay a message</a> for within the queue, before it can be delivered to a consumer.</li> <li>Must be a positive integer.</li> </ul></li> </ul> <div class="feedback-prompt-content astro-cedpceuv"><feedback-prompt class="not-content astro-x6kpz2mu"> <div id="feedback-thumbs" class="astro-x6kpz2mu"> <h2 class="astro-x6kpz2mu">Was this helpful?</h2> <div class="not-content astro-x6kpz2mu"> <svg width="1em" height="1em" class="astro-x6kpz2mu" data-icon="material-symbols:thumb-up-outline-rounded"> <title>Yes</title><symbol id="ai:material-symbols:thumb-up-outline-rounded" viewbox="0 0 24 24"> <path fill="currentColor" d="M21 8q.8 0 1.4.6T23 10v2q0 .175-.05.375t-.1.375l-3 7.05q-.225.5-.75.85T18 21H7V8l6-5.95q.375-.375.888-.437t.987.187t.7.7t.1.925L14.55 8zM9 8.85V19h9l3-7v-2h-9l1.35-5.5zM4 21q-.825 0-1.412-.587T2 19v-9q0-.825.588-1.412T4 8h3v2H4v9h3v2zm5-2V8.85z" /> </symbol><use href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#ai:material-symbols:thumb-up-outline-rounded"></use> </svg> <svg width="1em" height="1em" class="astro-x6kpz2mu" data-icon="material-symbols:thumb-down-outline-rounded"> <title>No</title><symbol id="ai:material-symbols:thumb-down-outline-rounded" viewbox="0 0 24 24"> <path fill="currentColor" d="M3 16q-.8 0-1.4-.6T1 14v-2q0-.175.05-.375t.1-.375l3-7.05q.225-.5.75-.85T6 3h11v13l-6 5.95q-.375.375-.888.438t-.987-.188t-.7-.7t-.1-.925L9.45 16zm12-.85V5H6l-3 7v2h9l-1.35 5.5zM20 3q.825 0 1.413.588T22 5v9q0 .825-.587 1.413T20 16h-3v-2h3V5h-3V3zm-5 2v10.15z" /> </symbol><use href="https://developers-cloudflare-com.translate.goog/queues/configuration/javascript-apis/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB#ai:material-symbols:thumb-down-outline-rounded"></use> </svg> </div> </div> <div id="feedback-yes" class="hidden astro-x6kpz2mu"> <h2 class="astro-x6kpz2mu">What did you like?</h2> <form class="astro-x6kpz2mu"> <fieldset class="astro-x6kpz2mu"> <div class="astro-x6kpz2mu"><input type="radio" id="accurate" value="accurate" name="reason" class="astro-x6kpz2mu"> <label for="accurate" class="astro-x6kpz2mu">Accurate</label> </div> <div class="astro-x6kpz2mu"><input type="radio" id="easy-to-understand" value="easy-to-understand" name="reason" class="astro-x6kpz2mu"> <label for="easy-to-understand" class="astro-x6kpz2mu">Easy to understand</label> </div> <div class="astro-x6kpz2mu"><input type="radio" id="solved-my-problem" value="solved-my-problem" name="reason" class="astro-x6kpz2mu"> <label for="solved-my-problem" class="astro-x6kpz2mu">Solved my problem</label> </div> <div class="astro-x6kpz2mu"><input type="radio" id="helped-me-decide-to-use-the-product" value="solved-my-problem" name="reason" class="astro-x6kpz2mu"> <label for="helped-me-decide-to-use-the-product" class="astro-x6kpz2mu">Helped me decide to use the product</label> </div> <div class="astro-x6kpz2mu"><input type="radio" id="other" value="other" name="reason" class="astro-x6kpz2mu"> <label for="other" class="astro-x6kpz2mu">Other</label> <input type="text" placeholder="Tell us more about your experience." id="info" name="info" class="astro-x6kpz2mu"> </div><input type="submit" value="Submit" class="astro-x6kpz2mu"> </fieldset> </form> </div> <div id="feedback-no" class="hidden astro-x6kpz2mu"> <h2 class="astro-x6kpz2mu">What went wrong?</h2> <form class="astro-x6kpz2mu"> <fieldset class="astro-x6kpz2mu"> <div class="astro-x6kpz2mu"><input type="radio" id="hard-to-understand" value="hard-to-understand" name="reason" class="astro-x6kpz2mu"> <label for="hard-to-understand" class="astro-x6kpz2mu">Hard to understand</label> </div> <div class="astro-x6kpz2mu"><input type="radio" id="incorrect-information" value="incorrect-information" name="reason" class="astro-x6kpz2mu"> <label for="incorrect-information" class="astro-x6kpz2mu">Incorrect information</label> </div> <div class="astro-x6kpz2mu"><input type="radio" id="missing-the-information" value="missing-the-information" name="reason" class="astro-x6kpz2mu"> <label for="missing-the-information" class="astro-x6kpz2mu">Missing the information</label> </div> <div class="astro-x6kpz2mu"><input type="radio" id="other" value="other" name="reason" class="astro-x6kpz2mu"> <label for="other" class="astro-x6kpz2mu">Other</label> <input type="text" placeholder="Tell us more about your experience." id="info" name="info" class="astro-x6kpz2mu"> </div><input type="submit" value="Submit" class="astro-x6kpz2mu"> </fieldset> </form> </div> <div id="feedback-thanks" class="hidden astro-x6kpz2mu"> <h2 class="astro-x6kpz2mu">Thank you for helping improve Cloudflare's documentation!</h2> </div> </feedback-prompt> <script type="module">class r extends HTMLElement{connectedCallback(){const d={'[data-icon="material-symbols:thumb-up-outline-rounded"]':"#feedback-yes",'[data-icon="material-symbols:thumb-down-outline-rounded"]':"#feedback-no"},s=this.querySelector("#feedback-thumbs"),o=this.querySelector("#feedback-thanks");if(!(!s||!o))for(const[i,n]of Object.entries(d))this.querySelector(i)?.addEventListener("click",()=>{s.classList.add("hidden");const e=this.querySelector(n);if(!e)return;e.classList.remove("hidden");const a=e.querySelector("form");a&&a.addEventListener("submit",async c=>{c.preventDefault();const t=new FormData(c.target);t.set("page",window.location.pathname),t.set("option",n.split("-")[1]),fetch("https://feedback.developers.cloudflare.com",{method:"POST",body:t}),e.classList.add("hidden"),o.classList.remove("hidden")})})}}customElements.define("feedback-prompt",r);</script> </div> </div> <footer class="sl-flex astro-3yyafb3n"> <div class="meta sl-flex astro-3yyafb3n"><a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://github.com/cloudflare/cloudflare-docs/edit/production/src/content/docs/queues/configuration/javascript-apis.mdx" class="sl-flex astro-eez2twj6"> <svg aria-hidden="true" class="astro-eez2twj6 astro-c6vsoqas" width="16" height="16" viewbox="0 0 24 24" fill="currentColor" style="--sl-icon-size: 1.2em;"> <path d="M22 7.24a1 1 0 0 0-.29-.71l-4.24-4.24a1 1 0 0 0-1.1-.22 1 1 0 0 0-.32.22l-2.83 2.83L2.29 16.05a1 1 0 0 0-.29.71V21a1 1 0 0 0 1 1h4.24a1 1 0 0 0 .76-.29l10.87-10.93L21.71 8c.1-.1.17-.2.22-.33a1 1 0 0 0 0-.24v-.14l.07-.05ZM6.83 20H4v-2.83l9.93-9.93 2.83 2.83L6.83 20ZM18.17 8.66l-2.83-2.83 1.42-1.41 2.82 2.82-1.41 1.42Z" /> </svg> Edit page</a> </div> <div class="pagination-links astro-u2l5gyhi" dir="ltr"> </div> </footer> <div class="items-center flex flex-wrap astro-fxeopwe4"> <a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://dash.cloudflare.com" class="mx-2 my-2 text-xs text-black dark:text-white decoration-accent-600 dark:decoration-accent-200 astro-fxeopwe4"><span class="astro-fxeopwe4">Cloudflare Dashboard</span></a><a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://discord.cloudflare.com" class="mx-2 my-2 text-xs text-black dark:text-white decoration-accent-600 dark:decoration-accent-200 astro-fxeopwe4"><span class="astro-fxeopwe4">Discord</span></a><a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://community.cloudflare.com" class="mx-2 my-2 text-xs text-black dark:text-white decoration-accent-600 dark:decoration-accent-200 astro-fxeopwe4"><span class="astro-fxeopwe4">Community</span></a><a href="https://translate.google.com/website?sl=pl&tl=en&hl=en-GB&u=https://www.cloudflare.com/learning/" class="mx-2 my-2 text-xs text-black dark:text-white decoration-accent-600 dark:decoration-accent-200 astro-fxeopwe4"><span class="astro-fxeopwe4">Learning Center</span></a><a href="https://developers-cloudflare-com.translate.goog/support/contacting-cloudflare-support/?_x_tr_sl=pl&_x_tr_tl=en&_x_tr_hl=en-GB" class="mx-2 my-2 text-xs text-black dark:text-white decoration-accent-600 dark:decoration-accent-200 astro-fxeopwe4"><span class="astro-fxeopwe4">Support Portal</span></a> <div class="mx-2 my-2 text-xs text-black dark:text-white underline decoration-accent-600 dark:decoration-accent-200 astro-fxeopwe4"> <script src="https://ot.www.cloudflare.com/public/vendor/onetrust/scripttemplates/otSDKStub.js" type="text/javascript" charset="UTF-8" data-domain-script="b1e05d49-f072-4bae-9116-bdb78af15448"></script> <script type="text/javascript"> function OptanonWrapper() {} </script><span class="DocsFooter--content-additional-wrapper astro-hwxmvrii"> <!-- OneTrust Cookies Settings button start --> <a role="button" id="ot-sdk-btn" class="ot-sdk-show-settings astro-hwxmvrii">Cookie Settings</a> <!-- OneTrust Cookies Settings button end --> </span> </div> </div> </div> </div> </main> </div> </div> </div> </div> <script defer src="https://static.cloudflareinsights.com/beacon.min.js/vcd15cbe7772f49c399c6a5babf22c1241717689176015" integrity="sha512-ZpsOmlRQV6y907TI0dKBHq9Md29nnaEIPlkf84rnaERnq6zvWvPUqr2ft8M1aS28oN72PdrCzSjY4U6VaAw1EQ==" data-cf-beacon="{"rayId":"8ead273bbba9ce12","version":"2024.10.5","serverTiming":{"name":{"cfExtPri":true,"cfL4":true,"cfSpeedBrain":true,"cfCacheStatus":true}},"token":"0589387b238e41af8aafea4d88cd2c64","b":1}" crossorigin="anonymous"></script> <script>function gtElInit() {var lib = new google.translate.TranslateService();lib.translatePage('pl', 'en', function () {});}</script> <script src="https://translate.google.com/translate_a/element.js?cb=gtElInit&hl=en-GB&client=wt" type="text/javascript"></script> </body> </html>