OxL Reference

kw activate

Contextual keyword — on … in an actor (§12.5)

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 ) ;

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

Related diagnostics

actor-not-hosted

See also