OxL Справочник OxL
РусскийEnglish

error saga-without-role

error Стандарт: [§12.1]

Сага без роли, которая её выполняет.

What it means#

A saga runs on the nodes of roles with runs sagas, and its log needs a role with journal. A cluster that declares a saga must have both.

Example#

oxl✓ проверяется в CI
service Ledger {
  @public @idempotent rpc charge(id: u64) -> u64
}

impl Ledger {
  rpc charge(id) { id }
}

saga order(x: u64) -> u64 {      // <- saga-without-role
  Ledger.charge(x)
}

cluster demo { role api { serves Ledger } }
error
saga-without-role

How to fix#

Add role saga { runs sagas } and a journal role.

oxl✓ проверяется в CI
service Ledger {
  @public @idempotent rpc charge(id: u64) -> u64
}

impl Ledger {
  rpc charge(id) { id }
}

saga order(x: u64) -> u64 {
  Ledger.charge(x)
}

cluster demo {
  role api { serves Ledger }
  role saga { runs sagas; journal }
}

See also#

OxL 1.0.0-beta · Версия документации 1.0.0-beta© OxwaldLink · сгенерировано из Стандарта, исходников std и руководства