OxL Reference

kw within

Contextual keyword — chain suffixes (§8.4)

The list of words: §1.4

Syntax

ebnf
Suffix      = "within" Binary | "retry" Binary [ "on" Type ] [ "backoff" Binary ] ;

Grammar: App. A

Defined in

Examples

oxl
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 page

— 8.4 Chains

oxl
let byRegion = cluster.shards(db.Order)
  .map(o => (o.region, o.total))          // executed on the shard owners
  .reduceBy(.0, (a, b) => a + b)          // partial aggregation, then merge
  within REPORT_DEADLINE

cluster.leader("nightly-report") { every(REPORT_PERIOD) { buildReport() } }
cluster.lock("user:{uid}", ttl: LOCK_TTL) { migrateUser(uid) }

— 12.6 Distributed computation

Related diagnostics

it-outside-chain, chained-comparison

See also