Esempio n. 1
0
    def __init__(self, name, pub_endpoint, router_endpoint, peer_names, **kwargs):
        RaftBaseNode.__init__(self, name, pub_endpoint, router_endpoint, peer_names, **kwargs)
        self.data_store = {}

        # Add message handlers for the client-facing get/set commands. Note that
        # these are not raw messages from the broker -- the client process will put them
        # into a better format. Names are in caps so the broker doesn't mess with them.

        self.message_handlers.update({
            'GET': self.handle_clientget,
            'SET': self.handle_clientset
        })

        # A dict of GET requests
        self.getReq_info = {}
Esempio n. 2
0
 def revert_state(self, term):
     RaftBaseNode.revert_state(self, term)
     self.getReq_info.clear()