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

data Fence

The fencing token of a held lock (cluster.lockFenced).

Example:

oxl✓ проверяется в CI
fn main() io, net, time {
  let r = cluster.lockFenced("job", body: (f: Fence) => "{f.key} {f.token > 0}")
  match r {
    str s => print(s)
    LockTimeout _ => print("busy")
    NetError _ => print("unavailable")
  }
}
Вывод
job true
pub(api) data Fence

С версии. 1.0.0-beta

Поля

pub(api) key: str

The key of the held lock.

pub(api) token: i64

Fencing token: grows with every acquisition of the lock.

Методы

valid() -> bool
Still believed to hold the lock (renewed within the lease).

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

См. также