kw retry
Contextual keyword — chain suffixes (§8.4)
The list of words: §1.4
Syntax
Suffix = "within" Binary | "retry" Binary [ "on" Type ] [ "backoff" Binary ] ;Grammar: App. A
Defined in
- 8.4 Chains — A chain links asynchronous steps so that either the whole chain is executed or the first unhandled error is returned.
- 1.2 Statement termination — A statement is terminated by ; or by a line break.
- 1.4 Keywords — Reserved (cannot be used as names)
- 5.2 Precedence and associativity — Precedence and associativity
- 10.2 rpc attributes — Defaults for all rpcs are set in cluster { defaults { …
- 17.4 Timers and schedules — after, every, at are std.time functions with a closure as the last argument; they run in the current task until it is cancelled (for the bac
Examples
let page = Users.get(id)
-> (Orders.recent(it.id), Recs.for(it.id))
-> (orders, recs) => Page{ orders, recs }
~> Audit.log("page", id)
!> Timeout => Page.empty()
within PAGE_DEADLINE
retry 2
let html = await pagesleep(BACKOFF)
after(RETRY_DELAY) { retry() }
every(SYNC_PERIOD) { sync() }
at(cron"0 9 * * MON-FRI".in(tz"Europe/Moscow")) { report() }Related diagnostics
it-outside-chain, chained-comparison, attribute-not-applicable, cache-not-readonly, invalid-window, retry-not-idempotent, rpc-attr