class Node (Proposer, Acceptor, Learner):
'''
This class supports the common model where each node on a network preforms
all three Paxos roles, Proposer, Acceptor, and Learner.
'''
def __init__(self, messenger, node_uid, quorum_size):
self.messenger = messenger
self.node_uid = node_uid
self.quorum_size = quorum_size
@property
def proposer_uid(self):
return self.node_uid
def change_quorum_size(self, quorum_size):
self.quorum_size = quorum_size
def recv_prepare(self, from_uid, proposal_id):
self.observe_proposal( from_uid, proposal_id )
return super(Node,self).recv_prepare( from_uid, proposal_id )