~/bend-docscommunity

src/DbLockPolicy.bend checks

raw source on the hub · import mylsm-lsm-store@0.6.0.1/src/DbLockPolicy.bend as DbLockPolicy

2 imports
import Base
import ./DurableError.bend as DurableError

Types

type WaitDecision source · line 5 · raw

Data

Describes the pure outcome of one bounded lock-wait decision.

Definitions

def busy_code source · line 12 · raw

@+code:U32 -> Bool

Recognizes the host errno values for lock contention.

def missing_code source · line 16 · raw

@+code:U32 -> Bool

Recognizes the host errno for a missing path.

def unsupported_code source · line 20 · raw

@+code:U32 -> Bool

Recognizes unavailable lock or FFI primitives on supported POSIX hosts.

def classify_nonbusy_lock_error source · line 25 · raw

@missing:Bool -> @code:U32 -> @message:String -> @operation:String -> @path:String -> 0xdd46804cd6318755b753109f15ff3725/src/DurableError.Error

Maps non-contention lock errors to NotFound or Io.

def classify_lock.nonbusy.platform source · line 38 · raw

@unsupported:Bool -> @missing:Bool -> @code:U32 -> @message:String -> @operation:String -> @path:String -> 0xdd46804cd6318755b753109f15ff3725/src/DurableError.Error

def classify_lock_nonbusy source · line 54 · raw

@unsupported:Bool -> @missing:Bool -> @code:U32 -> @message:String -> @operation:String -> @path:String -> 0xdd46804cd6318755b753109f15ff3725/src/DurableError.Error

Classifies non-contention lock failures before preserving host details.

def classify_lock_busy source · line 66 · raw

@busy:Bool -> @+code:U32 -> @message:String -> @operation:String -> @path:String -> 0xdd46804cd6318755b753109f15ff3725/src/DurableError.Error

Maps contention to Busy and retains host details.

def classify_lock_error source · line 75 · raw

@+code:U32 -> @message:String -> @operation:String -> @path:String -> 0xdd46804cd6318755b753109f15ff3725/src/DurableError.Error

Maps lock errors using the pure platform policy.

def busy_wait.remaining source · line 79 · raw

@remaining_ms:Nat -> @backoff_ms:Nat -> WaitDecision

Chooses a bounded sleep or timeout after a contended lock attempt.

def busy_wait_decision source · line 87 · raw

@elapsed_ms:Nat -> @timeout_ms:Nat -> @backoff_ms:Nat -> WaitDecision

Chooses a bounded sleep or timeout after a contended lock attempt.

def wait_decision source · line 91 · raw

@acquired:Bool -> @busy:Bool -> @elapsed_ms:Nat -> @timeout_ms:Nat -> @backoff_ms:Nat -> WaitDecision

Selects acquired, retry, timeout, or fatal handling from raw lock facts.

def wait_options_valid source · line 104 · raw

@timeout_ms:U32 -> @+backoff_ms:U32 -> Bool

Bounds the public timeout and nonzero backoff before any host effect.