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

method ClusterApi.now

cluster.now() (§12.6, §17.3): a hybrid logical clock stamp of a new local event. Strictly increasing on a node, and above every stamp the node saw from a peer (the stamps travel in every message between nodes), so it orders events across nodes.

Example:

oxl✓ проверяется в CI
fn main() io {
  let a = cluster.now()
  let b = cluster.now()
  print("{a < b}")
}
Вывод
true
pub(api) fn now() -> Hlc

Потокобезопасность. safe from any task; stamps of one node strictly increase.

С версии. 1.0.0-beta

Возвращает

Hlc

Эффекты

не объявлены (чистая, пока тело не говорит иное)

Определено в: std/core/node.oxl:355

См. также