def retake
import cswap-bend-cli@0.1.0.0/dirlock.bend as Dirlockimport Base
import cswap-bend-cli@0.1.0.0/act.bend as Act
64# Take over a stale lock, wait a beat, try again.
65def retake(+dir: String, +staleness: U32) -> Act.of(Bool):
66 do ActM<Bool>:
67 st : Bool <- is_stale(dir, staleness)
68 reclaim(st, dir)
69 Act.lift(Unit, IO.sleep(poll_ms()))
70 take_once(dir)