コード例 #1
0
ファイル: host_agent.py プロジェクト: zaheerm/feat
    def startup(self, state):
        desc = state.medium.get_descriptor()

        f = fiber.succeed()
        if state.partners.shard is None:
            f.add_callback(fiber.drop_param, self.start_join_shard_manager)

        # this agent is restarted by the agency not the monitor agent
        # for this reason we need to mind the restarted notifications
        # in a special way (ourselves)
        if desc.instance_id > 1:
            own = self.get_own_address()
            fibers = list()
            for partner in state.partners.all:
                fibers.append(requester.notify_restarted(self, partner.recipient, own, own))
            if fibers:
                fl = fiber.FiberList(fibers, consumeErrors=True)
                f.chain(fl)
        return f
コード例 #2
0
 def notify_restarted(self, state, recp, origin, new_address):
     return requester.notify_restarted(self, recp, origin, new_address)