@ @idle
@idle(d)
Applies to: actor, actor field
Section: §12.5
Syntax
Attr = "@" Path [ "(" [ AttrArgs ] ")" ] ;Grammar: App. A
Defined in
- 12.5 Sharded actors — The key is declared in the header (sharded by name
- 4.9 Attributes — Syntax: @name or @name(arguments) before a declaration, field, parameter or rpc.
Examples
@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)