Blyx Nest Blyx language
Registry / Library
library · v0.1.0

LeaseClock

Classify a message lease against a single monotonic clock.

Source repository · Package JSON

Use LeaseClock

use vendor::leaseclock::leaseclock;

Run the example

nest demo leaseclock@0.1.0
blyxc native-run leaseclock-demo/main.blyx
Example source and expected output
use vendor::leaseclock::leaseclock;

fn main() {
    let issued = 10.0;
    let ttl = 5.0;
    let now = 13.0;
    let result = leaseclock_remaining(issued, ttl, now);
    if len(result) == 0 { println!("invalid"); return; }
    let mut i = 0;
    while i < len(result) {
        println!(at(result, i));
        i += 1;
    }
}

Expected output

1
2
0

Published versions

VersionPackageSource commitSHA-256
0.1.0Download ZIP81b473a7fa2cc8cd37cb85aa80e2870b802a0934719ef79248d037b983d9dddd9d936a3a37