def flush.result

mylsm-lsm-store@0.6.0.1 · src/transfer/RestoreIo.bend:162

import mylsm-lsm-store@0.6.0.1/src/transfer/RestoreIo.bend as RestoreIo
import Base
import mylsm-lsm-store@0.6.0.1/src/ByteDurableDb.bend as Db

162def flush.result(
163  path: String,
164  pair: Db.Handle & Result<&1, &1, Db.Error, Unit>
165) -> IO(Result<&1, &1, Error, Unit>):
166  match pair:
167    case (handle, Fail{error}): cleanup.handle(path, handle, error)
168    case (handle, Done{Unit{}}):
169      do IO<Result<&1, &1, Error, Unit>>:
170        closed : Result<&1, &1, Db.Error, Unit> <- Db.close(handle)
171        result : Result<&1, &1, Error, Unit> <- flush.closed(path, closed)
172        return result

Uses (14)

Used by (1)