dscale 0.6.2

A fast & deterministic simulation framework for benchmarking and testing distributed systems
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use std::sync::atomic::Ordering;

use crate::services::{Services, with_services};

impl Services {
    fn unique_id(&self) -> usize {
        self.tso.fetch_add(1, Ordering::Relaxed)
    }
}

/// Generates a globally unique monotonic ID.
pub fn unique_id() -> usize {
    with_services(|services| services.unique_id())
}