OxL Reference

data Fence

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

Example:

oxl✓ checked in 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")
  }
}
Output
job true
pub(api) data Fence

Since. 1.0.0-beta

Fields

pub(api) key: str

The key of the held lock.

pub(api) token: i64

Fencing token: grows with every acquisition of the lock.

Methods

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

Defined in: std/core/node.oxl:801

See also