def live_claim

cswap-bend-cli@0.1.0.0 · pollrow.bend:101

import cswap-bend-cli@0.1.0.0/pollrow.bend as Pollrow
import Base

101# A fetch lease is live: claimUntil when present, else the legacy 10 s after
102# lastAttemptAt.
103def live_claim(claim_until: Maybe<&2, U32>, last_attempt: Maybe<&2, U32>, +now: U32) -> Bool:
104  match claim_until:
105    case Some{c}:
106      U32.is_lt(now, c)
107    case None{}:
108      legacy_claim(last_attempt, now)

Uses (5)

Used by (1)