RustNet

A Fast and Reactive Distributed Systems ToolBox

charachteristics

install

Add this to your cargo.toml file rust_net = "0.1.1"

Components

Node

PS: Order of Components mut be respected in order for Node to work correctly, For example the all Reliable Delivery Components Requires a Faillure detector

Faillure Detector

Delivery

Example

``` let peers = vec![

    String::from("172.17.0.2:8888"),
    String::from("172.17.0.3:8888"),
    String::from("172.17.0.4:8888"),
    String::from("172.17.0.5:8888"),
]

let mut node = Node::new("MyNode".to_string(), 8888, 5);

node.hasfailluredetector(Duration::frommillis(5000), Duration::frommillis(5000)) .onreceivemessage( MessageType::UniformReliableDelivery, Box::new(|msg| println!("FROM USER: Triggering my callback")), ) .hasuniformreliable_delivery();

node.start().join().expect("Failled Joining node handle"); ```

To Run the example open a terminal and type the following:

./Build.sh ./Run.sh

this will create a mesh network with 4 nodes, each node runing in a seperate docker container:

https://user-images.githubusercontent.com/24751547/166156115-513458b9-7c33-4fb6-b850-ea50e4a48212.mp4

Contact

email : salih.houadef@univ-constantine2.dz

linkedin : https://www.linkedin.com/in/houadef-salih-2b92a0188