Giter Club home page Giter Club logo

swarm-rs's Introduction

swarm-rs

OVERVIEW

swarm-rs is a generalized distributed systems cluster communication framework. The main goal of this effort is to quickly and easily setup a variety of distributed systems topologies.

USAGE

SAMPLE DHT

// initialize topology builder
let dht_builder = DhtBuilder::new(
    vec!(0, 6148914691236516864, 12297829382473033728));

// initialize swarm
let address = "127.0.0.1:12000".parse()
    .expect("parse seed addr");
let seed_address = "127.0.0.1:12010".parse()
    .expect("parse seed addr");
let (mut swarm, dht) =
    Swarm::new(0, address, Some(seed_address), dht_builder);

// set swarm instance metadata
swarm.set_metadata("rpc_addr", "127.0.0.1:12002");
swarm.set_metadata("xfer_addr", "127.0.0.1:12003");

// start swarm
swarm.start().expect("swarm start");

{
    let dht = dht.read().unwrap();
        match dht.get(0) {
            Some(node) => println!("{:?}",
                node.get_metadata("rpc_addr")),
            None => println!("node not found"),
    }
}

// stop swarm
swarm.stop().expect("swarm start");

TODO

  • remove nodes function from dht, either:
    • add to swarm
    • return nodes in tuple on Swarm::new(...)
  • test get_metadata
  • improve logging - info when starting everything
  • implement master / slave topology
  • implement mock topology

swarm-rs's People

Contributors

hamersaw avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.