Algorithm::Paxos::Role::Acceptor - An Acceptor role for the Paxos algorithm
package MyApp::PaxosBasic; use Moose; with qw(Algorithm::Paxos::Role::Acceptor); 1; __END__
The Acceptors act as the fault-tolerant "memory" of the protocol. Acceptors are collected into groups called Quorums. Any message sent to an Acceptor must be sent to a Quorum of Acceptors. Any message received from an Acceptor is ignored unless a copy is received from each Acceptor in a Quorum.
Internal method used by the algorithm. Returns the last id for a prepared proposal.
Internal method used by the algorithm. Returns the last id for an accepted proposal.
Returns a list of learners.
One of the two required methods for an Acceptor. When a proposal is made, the first step is to ask acceptors to prepare. If the proposed ID is too low (meaning another proposal is already in process) an exception will be thrown. If the proposal is new the ID returned is 0. If there is a pending proposal the ID for that proposal is returned.
One of two required methods for an Acceptor. After a quorum is reached a proposal is then accepted and submitted to the learners. If all the learners return clean the proposal id and value are returned. If the ID for the proposal exceeds the allowed value (ie we're trying to accept an ID that is lower than a prepared ID) we throw an exception.
Chris Prather <email@example.com>
This software is copyright (c) 2012 by Chris Prather.