disruptor-rs 0.1.1

A high-performance ring buffer implementation of the LMAX Disruptor pattern
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use std::sync::Arc;

use crate::sequence::AtomicSequence;

pub struct Utils;

impl Utils {
    pub fn get_minimum_sequence(sequences: &[Arc<AtomicSequence>]) -> i64 {
        sequences.iter().map(|s| s.get()).min().unwrap_or_default()
    }

    pub fn get_maximum_sequence(sequences: &[Arc<AtomicSequence>]) -> i64 {
        sequences.iter().map(|s| s.get()).max().unwrap_or_default()
    }
}