def acquire_wait.opened

mylsm-lsm-store@0.6.0.1 · src/DbLock.bend:340

import mylsm-lsm-store@0.6.0.1/src/DbLock.bend as DbLock
import Base
import mylsm-lsm-store@0.6.0.1/src/DurableError.bend as DurableError
import mylsm-lsm-store@0.6.0.1/src/Fs.bend as Fs

340# Opens the stable lock file and samples the monotonic start time.
341def acquire_wait.opened(
342  result: Result<&1, &1, U32 & String, File>,
343  operation: String,
344  path: String,
345  timeout_ms: U32,
346  backoff_ms: U32
347) -> IO(Result<&1, &1, DurableError.Error, Lock>):
348  match result:
349    case Fail{error}:
350      open_failed(error, operation, path)
351    case Done{file}:
352      do IO<Result<&1, &1, DurableError.Error, Lock>>:
353        started : Result<&1, &1, U32 & String, Nat> <- Fs.clock_monotonic()
354        acquire_wait.started(file, operation, path, timeout_ms, backoff_ms, started)

Uses (13)

Used by (1)