Documentation
¶
Overview ¶
Package Paxos is a implement for consensus protocol algorithm "Paxos". The interface of this package is experimental and may change.
There are three role play in this algorithm: "Acceptor", "Proposer" and "Learner".
Index ¶
Constants ¶
View Source
const ( Prepare msgType = iota + 1 // Send from proposer -> acceptor Promise // Send from acceptor -> proposer Propose // Send from proposer -> acceptor Accept // Send from acceptor -> learner )
Variables ¶
This section is empty.
Functions ¶
func CreateNetwork ¶
func CreateNetwork(nodes ...int) *network
func NewAcceptor ¶
Create a accetor and also assign learning IDs into acceptor. Acceptor: Will response request from proposer, promise the first and largest seq number propose.
After proposer reach the majority promise. Acceptor will pass the proposal value to learner to confirn and choose.
func NewLearner ¶
Initilize learner and prepare message pool.
func NewProposer ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.