def held

cswap-bend-cli@0.1.0.0 · daemon/pidlock.bend:68

import cswap-bend-cli@0.1.0.0/daemon/pidlock.bend as Pidlock
import Base
import cswap-bend-cli@0.1.0.0/fs.bend as Fs
import cswap-bend-cli@0.1.0.0/act.bend as Act

68def held(-A: Type, +state_dir: String, m: Maybe<&1, File>, act: Act.of(A)) -> Act.of(A):
69  match m:
70    case None{}:
71      busy_fail(A, state_dir)
72    case Some{f}:
73      IO.bind(Fs.Res(Unit), Fs.Res(A), claim(state_dir), c => run_held(A, state_dir, f, c, act))

Uses (10)

Used by (1)