def lock_result

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

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

72# Returns an owned lock on success or closes the failed handle.
73def lock_result(
74  pair: File & Result<&1, &1, U32 & String, Unit>,
75  operation: String,
76  path: String
77) -> IO(Result<&1, &1, DurableError.Error, Lock>):
78  match pair:
79    case (file, Fail{error}):
80      lock_failed(file, error, operation, path)
81    case (file, Done{Unit{}}):
82      IO.pure(Result<&1, &1, DurableError.Error, Lock>, Done{Lock{file}})

Uses (12)

Used by (1)