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

create(client, task, input)

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.

list(client, task)

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.

remove(client, task)

@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.

renew(client, task, input)

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.