def __call__(self):
        assert me.id
        should_process = self.roles
        rlog = log.sublog("convoy-resolver", LOGLVL_DEBUG)
        while True:
            for r in should_process:
                if r in self.roles_wanted:
                    resp = self.ns.add(r.name(), me.id, r.limit)
                    ans = None
                    if type(resp) == ConsensusSet:
                        self.roles_owned.add(r)
                        ans = resp
                    else:
                        if r in self.roles_owned:
                            self.roles_owned.remove(r)
                        if resp.set:
                            ans = resp.set
                else:
                    ans = self.ns.lookup(r.name())

                if ans:
                    self.role_clocks[r.name()] = ans.clock
                    for m in self.role_messages[r]:
                        self.routes[m] = ans.members

            if should_process:
                self.log_resolution_table(rlog, should_process)
                self.table_changes.put(None)
            wait_result = self.ns.wait(5, self.role_clocks)
            if type(wait_result) == ConvoyWaitDone:
                should_process = set([self.role_by_name[wait_result.key]])
            else:
                should_process = set()
            self.ns.alive()
dataset/ETHPy150Open dieseldev/diesel/diesel/convoy/__init__.py/Convoy.__call__/original