Sha256: d1aaede3e3f7bb2785ebf9f3db356a33fe6613e54e646f8fc7369ea5dbbacffb

Contents?: true

Size: 632 Bytes

Versions: 2

Compression:

Stored size: 632 Bytes

Contents

module DCell
  # Directory of nodes connected to the DCell cluster
  module Directory
    extend self

    # Get the URL for a particular Node ID
    def get(node_id)
      DCell.registry.get_node node_id
    end
    alias_method :[], :get

    # Set the address of a particular Node ID
    def set(node_id, addr)
      DCell.registry.set_node node_id, addr
    end
    alias_method :[]=, :set

    # List all of the node IDs in the directory
    def all
      DCell.registry.nodes
    end

    def clear_all
      DCell.registry.clear_all_nodes
    end

    def remove(node)
      DCell.registry.remove_node node
    end
  end
end

Version data entries

2 entries across 2 versions & 2 rubygems

Version Path
dcell-0.16.1 lib/dcell/directory.rb
stn-dcell-0.16.0 lib/dcell/directory.rb