// NewConn creates a new Conn to a cluster defined by the address of one of its members. func NewConn(addr string) (result *Conn, err error) { result = &Conn{ring: common.NewRing()} var newNodes common.Remotes err = common.Switch.Call(addr, "Discord.Nodes", 0, &newNodes) result.ring.SetNodes(newNodes) return }
func NewNode(addr string) (result *Node) { return &Node{ ring: common.NewRing(), position: make([]byte, murmur.Size), addr: addr, exports: make(map[string]interface{}), metaLock: new(sync.RWMutex), routeLock: new(sync.Mutex), state: created, } }