ArchAstro. V1. Tasks. Lease
(archastro v0.2.0)
Copy Markdown
Lease API resource.
Summary
Functions
Claim a task for a coding session
Retrieve a task's current session lease
Release a task session lease
Renew a task session lease
Functions
@spec create( ArchAstro.Client.t(), String.t(), ArchAstro.Types.Operations.PostApiV1TasksTaskLease.Input.t() ) :: {:ok, ArchAstro.Types.TaskSessionLease.t()} | {:error, ArchAstro.Error.reason()}
Claim a task for a coding session
Atomically claims a user-assigned task for the authenticated user's coding session. The caller generates and retains both UUIDs. An exact retry returns the existing lease without extending it; another live holder produces a conflict. Developer and server-to-server credentials cannot impersonate the assigned user.
The caller-held lease, including its fencing token.
@spec list(ArchAstro.Client.t(), String.t()) :: {:ok, ArchAstro.Types.TaskSessionLeaseSummary.t()} | {:error, ArchAstro.Error.reason()}
Retrieve a task's current session lease
Returns the authenticated assignee's viewer-safe live lease summary, or null when no live lease exists. Fencing and opaque session identifiers are never included.
Viewer-safe live lease summary, or null.
@spec remove(ArchAstro.Client.t(), String.t()) :: {:ok, :ok} | {:error, ArchAstro.Error.reason()}
Release a task session lease
Releases the authenticated assignee's matching live task lease. Repeating a release after the lease is absent succeeds. A different live successor lease returns a mismatch.
Empty response. HTTP 204 is returned after release is accepted.
@spec renew( ArchAstro.Client.t(), String.t(), ArchAstro.Types.Operations.PostApiV1TasksTaskLeaseRenew.Input.t() ) :: {:ok, ArchAstro.Types.TaskSessionLease.t()} | {:error, ArchAstro.Error.reason()}
Renew a task session lease
Renews the authenticated assignee's matching live task lease. Both caller-generated UUIDs must match the aggregate's current lease.
The renewed caller-held lease.