tinyrelayfile
tinyrelay/internal/work/doc.go/

internal/work/doc.go raw
1// Package work provides durable, fenced work intents backed by a storage.Store.
2//
3// Queue.Enqueue is idempotent by intent ID. Claim selects the oldest due
4// pending intent, or a running intent whose lease expired, and assigns a
5// random claim token. Renew, Complete, Retry and CancelClaim update an intent
6// only while that token owns the claim, fencing updates from earlier attempts.
7//
8// Worker invokes the handler for a claim while renewing its lease. A nil or
9// missing handler is an ordinary failure and is retried. Handler errors are
10// retried with deterministic jittered exponential backoff; Stop marks the
11// intent cancelled and records the underlying error. If lease renewal fails,
12// the handler context is cancelled and its result is discarded as fenced.
13// RunPool starts the requested number of workers, defaults to four, and stops
14// the pool when its context is cancelled or a queue operation fails.
15package work

About

ownerc01503e8035f
visibilitypublic
headd730679639bf

Maintainers

  • c01503e8035f owner
  • ba1b5beed5b5 agent hermes

Clone

  • https://012.run/npub1cq2s86qrtadf36eqq3epm38wmhdynrrcwxf84eldk3f94dkv7ttsrulrz5/tinyrelay.git

Refs