[{"data":1,"prerenderedAt":434},["ShallowReactive",2],{"navigation":3,"\u002Fconcepts\u002Ffencing-and-settles":115,"\u002Fconcepts\u002Ffencing-and-settles-surround":429},[4,36,57,88,104],{"title":5,"icon":6,"path":7,"stem":8,"children":9,"page":35},"Getting Started","i-lucide-rocket","\u002Fgetting-started","1.getting-started",[10,15,20,25,30],{"title":11,"path":12,"stem":13,"icon":14},"Introduction","\u002Fgetting-started\u002Fintroduction","1.getting-started\u002F1.introduction","i-lucide-info",{"title":16,"path":17,"stem":18,"icon":19},"Install","\u002Fgetting-started\u002Finstall","1.getting-started\u002F2.install","i-lucide-download",{"title":21,"path":22,"stem":23,"icon":24},"Quickstart","\u002Fgetting-started\u002Fquickstart","1.getting-started\u002F3.quickstart","i-lucide-zap",{"title":26,"path":27,"stem":28,"icon":29},"Testing","\u002Fgetting-started\u002Ftesting","1.getting-started\u002F4.testing","i-lucide-flask-conical",{"title":31,"path":32,"stem":33,"icon":34},"CLI","\u002Fgetting-started\u002Fcli","1.getting-started\u002F5.cli","i-lucide-terminal",false,{"title":37,"icon":38,"path":39,"stem":40,"children":41,"page":35},"Concepts","i-lucide-boxes","\u002Fconcepts","2.concepts",[42,47,52],{"title":43,"path":44,"stem":45,"icon":46},"SQL-first contract","\u002Fconcepts\u002Fsql-first-contract","2.concepts\u002F1.sql-first-contract","i-lucide-database",{"title":48,"path":49,"stem":50,"icon":51},"Jobs and status","\u002Fconcepts\u002Fjobs-and-status","2.concepts\u002F2.jobs-and-status","i-lucide-list-checks",{"title":53,"path":54,"stem":55,"icon":56},"Fencing and settles","\u002Fconcepts\u002Ffencing-and-settles","2.concepts\u002F3.fencing-and-settles","i-lucide-shield",{"title":58,"icon":59,"path":60,"stem":61,"children":62,"page":35},"API","i-lucide-code-2","\u002Fapi","3.api",[63,68,73,78,83],{"title":64,"path":65,"stem":66,"icon":67},"Enqueue","\u002Fapi\u002Fenqueue","3.api\u002F1.enqueue","i-lucide-plus-circle",{"title":69,"path":70,"stem":71,"icon":72},"Claim and heartbeat","\u002Fapi\u002Fclaim-and-heartbeat","3.api\u002F2.claim-and-heartbeat","i-lucide-hand",{"title":74,"path":75,"stem":76,"icon":77},"Worker and handlers","\u002Fapi\u002Fworker-and-handlers","3.api\u002F3.worker-and-handlers","i-lucide-cpu",{"title":79,"path":80,"stem":81,"icon":82},"HTTP facade","\u002Fapi\u002Fhttp-facade","3.api\u002F4.http-facade","i-lucide-globe",{"title":84,"path":85,"stem":86,"icon":87},"Authorization","\u002Fapi\u002Fauthorization","3.api\u002F5.authorization","i-lucide-key-round",{"title":89,"icon":90,"path":91,"stem":92,"children":93,"page":35},"Operations","i-lucide-activity","\u002Foperations","4.operations",[94,99],{"title":95,"path":96,"stem":97,"icon":98},"Housekeeping","\u002Foperations\u002Fhousekeeping","4.operations\u002F1.housekeeping","i-lucide-timer",{"title":100,"path":101,"stem":102,"icon":103},"Redrive and dead letters","\u002Foperations\u002Fredrive-and-dlq","4.operations\u002F2.redrive-and-dlq","i-lucide-rotate-ccw",{"title":105,"icon":106,"path":107,"stem":108,"children":109,"page":35},"Reference","i-lucide-book-marked","\u002Freference","5.reference",[110],{"title":111,"path":112,"stem":113,"icon":114},"Configuration","\u002Freference\u002Fconfiguration","5.reference\u002F1.configuration","i-lucide-settings",{"id":116,"title":53,"body":117,"description":422,"extension":423,"links":424,"meta":425,"navigation":426,"path":54,"seo":427,"stem":55,"__hash__":428},"docs\u002F2.concepts\u002F3.fencing-and-settles.md",{"type":118,"value":119,"toc":418},"minimark",[120,133,138,218,223,227,230,342,360,414],[121,122,123,124,128,129,132],"p",{},"Every claim creates a server-generated ",[125,126,127],"code",{},"attempt_id",". Heartbeat and settle verbs CAS on ",[125,130,131],{},"(job_id, attempt_id)",".",[134,135,137],"h2",{"id":136},"settle-results","Settle results",[139,140,141,154],"table",{},[142,143,144],"thead",{},[145,146,147,151],"tr",{},[148,149,150],"th",{},"Result",[148,152,153],{},"Meaning",[155,156,157,168,178,188,198,208],"tbody",{},[145,158,159,165],{},[160,161,162],"td",{},[125,163,164],{},"ok",[160,166,167],{},"Transition applied",[145,169,170,175],{},[160,171,172],{},[125,173,174],{},"already_settled",[160,176,177],{},"Same verb already finished this attempt — treat as success on retry",[145,179,180,185],{},[160,181,182],{},[125,183,184],{},"settle_conflict",[160,186,187],{},"Different verb against an already-settled attempt",[145,189,190,195],{},[160,191,192],{},[125,193,194],{},"lost",[160,196,197],{},"Fence lost (another attempt owns the job)",[145,199,200,205],{},[160,201,202],{},[125,203,204],{},"retry_scheduled",[160,206,207],{},"Failure accepted; job re-queued with backoff",[145,209,210,215],{},[160,211,212],{},[125,213,214],{},"dead",[160,216,217],{},"Terminal failure",[121,219,220,221,132],{},"A dropped HTTP response after a successful settle is no longer indistinguishable from theft: retrying the same verb returns ",[125,222,174],{},[134,224,226],{"id":225},"handler-return-values","Handler return values",[121,228,229],{},"Handlers return typed results; the worker maps them to SQL:",[139,231,232,245],{},[142,233,234],{},[145,235,236,239,242],{},[148,237,238],{},"Return",[148,240,241],{},"Fields",[148,243,244],{},"Burns attempts?",[155,246,247,266,290,304,325],{},[145,248,249,254,263],{},[160,250,251],{},[125,252,253],{},"Complete",[160,255,256,259,260],{},[125,257,258],{},"result: dict",", optional ",[125,261,262],{},"followups",[160,264,265],{},"no",[145,267,268,273,285],{},[160,269,270],{},[125,271,272],{},"Snooze",[160,274,275,259,278,281,282],{},[125,276,277],{},"delay_seconds: int",[125,279,280],{},"progress",", ",[125,283,284],{},"reason",[160,286,287],{},[288,289,265],"strong",{},[145,291,292,297,302],{},[160,293,294],{},[125,295,296],{},"Cancel",[160,298,299],{},[125,300,301],{},"reason: str",[160,303,265],{},[145,305,306,311,322],{},[160,307,308],{},[125,309,310],{},"Retry",[160,312,313,314,281,317,281,320],{},"optional ",[125,315,316],{},"after_seconds",[125,318,319],{},"error",[125,321,280],{},[160,323,324],{},"yes",[145,326,327,332,339],{},[160,328,329],{},[125,330,331],{},"NonRetryable",[160,333,334,259,337],{},[125,335,336],{},"error: str",[125,338,280],{},[160,340,341],{},"terminal",[343,344,345],"warning",{},[121,346,347,348,351,352,355,356,359],{},"Non-empty ",[125,349,350],{},"Complete.followups"," are ",[288,353,354],{},"rejected"," by the 0.1 worker\u002FSQL (",[125,357,358],{},"followup_rejected","). The field is reserved for 0.2.",[361,362,367],"pre",{"className":363,"code":364,"language":365,"meta":366,"style":366},"language-python shiki shiki-themes material-theme-lighter material-theme material-theme-palenight","from taskq import Complete, Snooze\n\nasync def scrape(payload: Input) -> Complete | Snooze:\n    if quota_hit():\n        return Snooze(delay_seconds=3600, reason=\"provider_quota\")\n    data = await do_scrape(payload)\n    return Complete(result={\"n\": len(data)})\n","python","",[125,368,369,377,384,390,396,402,408],{"__ignoreMap":366},[370,371,374],"span",{"class":372,"line":373},"line",1,[370,375,376],{},"from taskq import Complete, Snooze\n",[370,378,380],{"class":372,"line":379},2,[370,381,383],{"emptyLinePlaceholder":382},true,"\n",[370,385,387],{"class":372,"line":386},3,[370,388,389],{},"async def scrape(payload: Input) -> Complete | Snooze:\n",[370,391,393],{"class":372,"line":392},4,[370,394,395],{},"    if quota_hit():\n",[370,397,399],{"class":372,"line":398},5,[370,400,401],{},"        return Snooze(delay_seconds=3600, reason=\"provider_quota\")\n",[370,403,405],{"class":372,"line":404},6,[370,406,407],{},"    data = await do_scrape(payload)\n",[370,409,411],{"class":372,"line":410},7,[370,412,413],{},"    return Complete(result={\"n\": len(data)})\n",[415,416,417],"style",{},"html .light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html.light .shiki span {color: var(--shiki-light);background: var(--shiki-light-bg);font-style: var(--shiki-light-font-style);font-weight: var(--shiki-light-font-weight);text-decoration: var(--shiki-light-text-decoration);}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":366,"searchDepth":373,"depth":379,"links":419},[420,421],{"id":136,"depth":379,"text":137},{"id":225,"depth":379,"text":226},"Attempt IDs, typed settle races, and handler return values.","md",null,{},{"icon":56},{"title":53,"description":422},"BeML_2DdNO6rM19sGHRIvPv-Ujx5T_Xn2zBfsNol1zQ",[430,432],{"title":48,"path":49,"stem":50,"description":431,"icon":51,"children":-1},"The six job statuses and what they mean.",{"title":64,"path":65,"stem":66,"description":433,"icon":67,"children":-1},"Typed enqueue results and 0.1 uniqueness.",1784549299452]