DbLock.acquire_wait.valid: def of mylsm-lsm-store@0.6.0.1 Import: import mylsm-lsm-store@0.6.0.1/src/DbLock.bend as DbLock Lines 356-371 of mylsm-lsm-store@0.6.0.1/src/DbLock.bend: https://jend.leeeet.dev/read.txt?path=mylsm-lsm-store@0.6.0.1/src/DbLock.bend&start_line=356&end_line=371 import Base import mylsm-lsm-store@0.6.0.1/src/DurableError.bend as DurableError # Opens and waits only after the pure option validation succeeds. def acquire_wait.valid( valid: Bool, +path: String, operation: String, +timeout_ms: U32, +backoff_ms: U32 ) -> IO(Result<&1, &1, DurableError.Error, Lock>): match valid: case False{}: IO.pure(Result<&1, &1, DurableError.Error, Lock>, Fail{DurableError.classify_open(DurableError.InvalidInput{}, operation, path)}) case True{}: do IO>: opened : Result<&1, &1, U32 & String, File> <- File.open(lock_path(path), "a") acquire_wait.opened(opened, operation, path, timeout_ms, backoff_ms) Uses (16): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=File https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=File.open https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/DbLock.bend&name=Lock https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/DbLock.bend&name=acquire_wait.opened https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/DbLock.bend&name=lock_path https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/DurableError.bend&name=Error https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/DurableError.bend&name=OpenCause https://jend.leeeet.dev/definition.txt?path=mylsm-lsm-store@0.6.0.1/src/DurableError.bend&name=classify_open