예제 #1
0
파일: raftNode.py 프로젝트: hallliu/s2014
    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 = {}