Struct paxos_rust::proposer::Proposer[][src]

pub struct Proposer<T> {
    pub id: u64,
    pub messenger: Option<Box<Messenger<T>>>,
    pub value: Option<Arc<T>>,
    pub proposal_n: u64,
    pub last_accepted_n: u64,
    pub promises_received: HashMap<u64, HashSet<PromiseData<T>>>,
    pub accepted_received: HashMap<u64, HashSet<AcceptedData<T>>>,
    pub quorum: u8,
}

A Proposer advocates a client request, attempting to convince the Acceptors to agree on it, and acting as a coordinator to move the protocol forward when conflicts occur.

Fields

Proposer's ID

Messenger specifying communication with other nodes

The proposed value

The highest proposal number seen

The last proposal that was accepted

Promises received (proposal_n => data)

Accepted messages received (proposal_n => data)

The minimum number of Acceptors needed to continue

Methods

impl<T: 'static> Proposer<T> where
    T: Eq + Hash + Clone
[src]

Creates a new Proposer.

The first phase. Creates a proposal.

Receives a Promise message from an Acceptor.

The second phase. Sets a value for the proposal, and builds an Accept request.

Receives an Accepted message from an Acceptor.

Trait Implementations

impl<T> Default for Proposer<T>
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations

impl<T> !Send for Proposer<T>

impl<T> !Sync for Proposer<T>