Skip to main content

mesh

Function mesh 

Source
pub fn mesh<T: Send>(parties: usize, capacity: usize) -> Vec<Party<T>>
Expand description

Builds a full mesh of parties parties, each pair joined by a bounded channel of capacity messages in each direction. Entry i of the answer is party i.

ยงPanics

When capacity is zero, as mpsc::channel does.

let parties = nuclei::sync::mesh::mesh::<u8>(3, 1);
assert_eq!(parties.len(), 3);
assert_eq!(parties[2].index(), 2);
assert_eq!(parties[2].parties(), 3);