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's Acquire mints a fresh token on each call, so calling it again to stay alive reads as a different holder and is refused while your own lock is live. Size the TTL for the whole job, or use the pattern below to hold one for longer.
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-1The Go SDK has the same capability. Lock.AcquireAs(name, owner, ttl) takes a stable owner you choose: it renews the lease if you already hold it, takes it if free or expired, and refuses if someone else holds it. Lock.Renew(name, token, ttl) then extends it without releasing first:
token, err := drift.Backbone.Lock.AcquireAs("payout:42", "worker-1", 30)
if err == nil {
drift.Backbone.Lock.Renew("payout:42", token, 30) // extend without losing the lock
}The other five SDKs expose only the fresh-token Acquire, with no lease equivalent yet.