OxL Reference

kw cluster

Reserved keyword

The list of words: §1.4

Syntax

ebnf
Cluster     = "cluster" Ident "{" { ClusterClause } "}" ;

Grammar: App. A

Defined in

Examples

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

oxl
let inc = x => x + 1
let add = (a: i32, b: i32) => a + b
users.map(.name)                     // = u => u.name
users.filter(.isActive())            // = u => u.isActive()
retryWith(3) { fetch() }             // a closure as the last argument
cluster.lock("k", ttl: LOCK_TTL) { migrate() }

— 5.7 Lambdas and closures

Related diagnostics

topic-without-journal, no-entry-point, actor-not-hosted, cluster-auth, cluster-decl, cluster-needs, cluster-seeds, placement-conflict, saga-without-role, service-not-served, unknown-role, fail-type, question-context, unhandled-error

See also