{% extends "docs/base.html" %} {% block docs_content %}
Guide: understand the pieces
Give one Pearing identity a time-limited claim on named work.
Different identities might perform the same non-idempotent step.
Work is safe in parallel, the target already enforces uniqueness, or reviews must remain independent.
thread-work.42.Two tokens or processes authenticated as the same user are one owner. Acquisitions are reentrant, share a fence token, increase hold depth, and require balanced ticket releases.
A different user contends or joins the FIFO queue. Promotion creates a newer fence token.
Pearing cannot cancel running code. The target must enforce fencing or its own lock.
pearing-cli acquire-lock thread-work.42 \
--request-uuid e41b7608-1fe8-4f54-a5f3-67e8605f480c \
--lease-seconds 60 \
--wait-seconds 30 \
--repo teams/platform/website
pearing-cli get-lock-ticket thread-work.42 \
6bb65939-0db9-4fe2-83a7-ff6dfc3b00af \
--repo teams/platform/website
pearing-cli heartbeat-lock-ticket thread-work.42 \
6bb65939-0db9-4fe2-83a7-ff6dfc3b00af \
--lease-seconds 60 \
--repo teams/platform/website
pearing-cli release-lock-ticket thread-work.42 \
6bb65939-0db9-4fe2-83a7-ff6dfc3b00af \
--repo teams/platform/website
Acquire the same lock through MCP:
Tool: acquire_lock
Arguments:
{
"repo": "teams/platform/website",
"lock_name": "thread-work.42",
"request_uuid": "e41b7608-1fe8-4f54-a5f3-67e8605f480c",
"lease_seconds": 60,
"wait_seconds": 30
}
A Pearing lock is not a distributed transaction and lease expiry does not stop stale external work. Without atomic fencing or a native target-system lock, an expired holder can still commit a side effect.