DbLockPolicy.busy_wait.remaining: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/DbLockPolicy.bend as DbLockPolicy Lines 78-84 of mylsm-lsm-store@0.6.0.1/src/DbLockPolicy.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/DbLockPolicy.bend&start_line=78&end_line=84 import Base # Chooses a bounded sleep or timeout after a contended lock attempt. def busy_wait.remaining(remaining_ms: Nat, backoff_ms: Nat) -> WaitDecision: match remaining_ms: case 0n: LockTimedOut{} case 1n+rest: LockRetry{Nat.min(backoff_ms, Nat.add(1n, rest))} Uses (4): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat.min https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/DbLockPolicy.bend&name=WaitDecision