def open.canonical

mylsm-lsm-store@0.6.0.1 · src/ByteDurableDb.bend:397

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

397# Acquires exclusive ownership before replaying the byte WAL.
398def open.canonical(
399  result: Result<&1, &1, U32 & String, String>
400) -> IO(Result<&1, &1, Error, Handle>):
401  match result:
402    case Fail{error}:
403      IO.pure(Result<&1, &1, Error, Handle>, Fail{io.error(error)})
404    case Done{+path}:
405      do IO<Result<&1, &1, Error, Handle>>:
406        acquired : Result<&1, &1, DurableError.Error, DbLock.Lock> <-
407          DbLock.acquire(path, "open_existing")
408        open.locked(path, acquired)

Uses (14)

Used by (1)