Lock.wait: def of cswap-bend-cli@0.1.0.0 Import: import cswap-bend-cli@0.1.0.0/lock.bend as Lock Lines 37-44 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=37&end_line=44 import Base import cswap-bend-cli@0.1.0.0/fs.bend as Fs # Retry `fuel` more times, 100 ms apart, until the lock is held. def wait(fuel: Nat, fr: File & Fs.Res(Bool)) -> IO(File & Fs.Res(Bool)): match fuel fr: case 1n++p Tuple{f, Done{False{}}}: IO.bind(Unit, File & Fs.Res(Bool), IO.sleep(poll_ms()), u => IO.bind(File & Fs.Res(Bool), File & Fs.Res(Bool), attempt(f), r => wait(p, r))) case _ _: IO.pure(File & Fs.Res(Bool), fr) Uses (14): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool 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=IO.pure https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=IO.sleep https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Pair https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma 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.bend&name=Res https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/lock.bend&name=attempt https://jend.leeeet.dev/definition.txt?path=cswap-bend-cli@0.1.0.0/lock.bend&name=poll_ms