Lock.acquire: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/lock.bend as Lock Lines 79-85 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=79&end_line=85 import Base import cswap-bend-cli@0.1.0.0/fs.bend as Fs import cswap-bend-cli@0.1.0.0/fs/write.bend as FsW # Take the lock at `path`, waiting up to `timeout_ms`. Done{Some{file}} holds # it (pass the file to `release`); Done{None} means the wait timed out. # Creates missing parent directories and truncates the lock file, as the # reference does. def acquire(+path: String, timeout_ms: U32) -> IO(Fs.Res(Maybe<&1, File>)): IO.bind(Fs.Res(Unit), Fs.Res(Maybe<&1, File>), FsW.mkdir_p(Fs.dirname(path)), r => parent.ok(r, timeout_ms, path)) Uses (11): 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=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/fs/write.bend&name=mkdir_p 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/fs.bend&name=dirname https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/lock.bend&name=parent.ok