def init (self, net=None, url=None): Master.init (self) if net: peer= None finished= self._terminate while not finished: peer= self.discover (net) finished= self._terminate or peer if peer: self.gossip (peer) self.propalate () return True else: return False if url: key= self.getNavelKey (url) peer= self._peers.getNavel (url, key) self.gossip (peer) self.propalate () return True return False
def init(self, net=None, url=None): Master.init(self) if net: peer = None finished = self._terminate while not finished: peer = self.discover(net) finished = self._terminate or peer if peer: self.gossip(peer) self.propalate() return True else: return False if url: key = self.getNavelKey(url) peer = self._peers.getNavel(url, key) self.gossip(peer) self.propalate() return True return False
def init (self, net=None): Master.init (self) self._data= UmbData (self._key, self._key) self._self= self._peers.getNavel (self._url, self._key, Normal) if net: # create a challenger for new nodes and such self._chal= Challenger (self) self._chal.start () # find a ring and join it or create a new one self.debug (1, 'ping') peer= self.discover (net, self._self) if peer==None: self.debug (1, "gave up! noone's here!") self.createRing () else: self.join (peer)