Lock.with_lock: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/lock.bend as Lock Lines 106-109 of cswap-bend-cli@0.1.0.0/lock.bend: https://jend.leeeet.dev/read.txt?path=cswap-bend-cli@0.1.0.0/lock.bend&start_line=106&end_line=109 import Base import cswap-bend-cli@0.1.0.0/fs.bend as Fs # Run `act` while holding the lock; the lock is released afterwards whatever # `act` answers. A timeout is Fail{(11, "Failed to acquire lock ...")}. def with_lock(-A: Type, path: String, timeout_ms: U32, act: IO(Fs.Res(A))) -> IO(Fs.Res(A)): IO.bind(Fs.Res(Maybe<&1, File>), Fs.Res(A), acquire(path, timeout_ms), m => held.run(A, act, m)) Uses (9): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=File https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.bind https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Maybe https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=String https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/fs.bend&name=Res https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/lock.bend&name=acquire https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/lock.bend&name=held.run