def Bytes.owner.wait.endpoint

mylsm-lsm-store@0.6.0.1 · mylsm.bend:384

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

384def Bytes.owner.wait.endpoint(
385  canonical: String,
386  timeout_ms: U32,
387  backoff_ms: U32,
388  exists: Result<&1, &1, U32 & String, Bool>
389) -> IO(Result<&1, &1, Bytes.Error, Bytes.Handle>):
390  match exists:
391    case Fail{(code, message)}:
392      IO.pure(Result<&1, &1, Bytes.Error, Bytes.Handle>,
393        Fail{Io{code, message}})
394    case Done{True{}}:
395      Bytes.canonical.endpoint.paths(Bytes.endpoint.path.pair(canonical))
396    case Done{False{}}:
397      do IO<Result<&1, &1, Bytes.Error, Bytes.Handle>>:
398        opened : Result<&1, &1, RawByteDb.Error, RawByteDb.Handle> <-
399          RawByteDb.open_existing_wait(canonical, timeout_ms, backoff_ms)
400        return Bytes.handle(opened)

Uses (17)

Used by (2)