def create.reserved

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

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

217# Converts successful directory reservation into lock acquisition.
218def create.reserved(
219  +path: String,
220  result: Result<&1, &1, U32 & String, Unit>
221) -> IO(Result<&1, &1, Error, Handle>):
222  match result:
223    case Fail{error}:
224      IO.pure(Result<&1, &1, Error, Handle>, Fail{io.error(error)})
225    case Done{Unit{}}:
226      do IO<Result<&1, &1, Error, Handle>>:
227        canonical : Result<&1, &1, U32 & String, String> <-
228          Fs.canonical_path(path)
229        create.canonical(canonical)

Uses (13)

Used by (1)