Backbone Locks
Distributed locks stop two workers doing the same job at once. Acquire returns a server-minted token you present to Release:
token, err := drift.Backbone.Lock.Acquire("payout:42", 30) // hold for up to 30s
if err == nil {
defer drift.Backbone.Lock.Release("payout:42", token)
// ... do the work exactly once ...
}A lock held by someone else answers 409, so the second worker backs off. Past your tier's concurrent-lock limit, acquire answers 429. A TTL of zero or less becomes 30 seconds. Lock names are not charset-restricted, so payout:42 is fine.
Every SDK Acquire mints a fresh token, so a function cannot extend a lock it holds. Size the TTL for the whole job. The CLI names the owner itself, which is what lets it renew:
drift backbone lock acquire payout-42 worker-1 --ttl 30
drift backbone lock renew payout-42 worker-1 --ttl 30
drift backbone lock release payout-42 worker-1