Nighttime Peanut Migrations
    Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »

    sombrero-gossippublic

    Sombrero Gossip

    Build Status Dependency Status

    To be used as part of a Sombrero Node. Implements a gossip protocol over a set of peers.

    Install

    $ npm install sombrero-gossip

    Require and Create

    var Gossip = require('sombrero-gossip');
    var options = {
      port: 7000
    };
    var gossip = Gossip(options);

    Options:

    • port: defaults to 8217
    • peers: array of peers, each containing an id, hostname and port attributes
    • interval: the interval with which it contacts other nodes

    API

    gossip.addPeer(peer)

    Add a peer. A peer must have the following attributes:

    • id
    • hostname
    • port

    gossip.removePeer(peerId)

    Removes a peer.

    gossip.cluster.set(key, value)

    Set a gossip value on the cluster.

    gossip.cluster.get(key)

    Returns the current known value.

    License

    ISC

    install

    npm i sombrero-gossip

    Downloadslast 7 days

    0

    version

    0.8.1

    license

    ISC

    repository

    github.com

    last publish

    collaborators

    • avatar