OxL Reference

kw on

Contextual keyword — pipeline steps (§10.6)

The list of words: §1.4

Syntax

ebnf
ActorMember = { Attr } ( "var" Ident ":" Type "=" Expr | "dep" Ident ":" Type
            | "msg" Ident "(" [ Params ] ")" [ "->" Type ] Block
            | "on" ( "activate" | "passivate" ) Block ) ;
ebnf
PStep       = ( "respond" Expr | Expr ) [ "on" Ident ] [ "durable" | "best_effort" ] ;
ebnf
Suffix      = "within" Binary | "retry" Binary [ "on" Type ] [ "backoff" Binary ] ;

Grammar: App. A

Defined in

Examples

oxl
@idle(ACCOUNT_IDLE)
actor Account sharded by id: AccountId {
  var balance: Money = Money.zero()
  @transient var hits: u64 = 0
  on activate { log.debug("account {id} up") }
  msg deposit(x: Money) { balance += x }
  msg balance() -> Money { balance }
}

Account(id).deposit(amount)

— 12.5 Sharded actors

oxl
pipeline uploadPhoto(img: Image) -> PhotoId {
  validate
  -> Store.put(it)              on storage
  -> respond it.id
  -> resize(it, THUMB_SIZES)    on gpu
  -> moderate                   on ml  durable
  -> SearchIndex.add(it)
} on_error(e, step) { Dlq.push(e, step) }

— 10.6 Pipelines

Related diagnostics

actor-not-hosted, pipeline-idempotency, respond-twice, respond-type, unknown-role, it-outside-chain, cluster-auth, cluster-decl, cluster-needs, cluster-seeds, placement-conflict, saga-without-role, service-not-served, topic-without-journal

See also