Skip to content

Locks

Objects defining lock behavior.

LockStatus

Bases: Enum

Status of a lock object in relation to a particular entity.

UNLOCKED: no lock exists STALE: lock exists but is old (can be safely overwritten) LOCKED: fresh lock exists and is not owned by the entity HELD: fresh lock exists and is owned by the entity INVALID: lock exists but cannot be decoded as text

check_lock

check_lock(bucket: Bucket, entity: TransferEntity, locker_id: str | None = None, staleness_threshold: int | None = None) -> LockStatus

Check the status of a client, validator, or lambda lock object. locker_id is the agent_id of the entity that might be expected to hold the lock (if the holder is important). See locks.LockStatus for a description of returned enum values.