Chris Prather > Algorithm-Paxos-0.001 > Algorithm::Paxos::Role::Proposer

Download:
Algorithm-Paxos-0.001.tar.gz

Dependencies

Annotate this POD

View/Report Bugs
Module Version: 0.001   Source  

NAME ^

Algorithm::Paxos::Role::Proposer - A Proposer role for the Paxos algorithm

VERSION ^

version 0.001

SYNOPSIS ^

    package MyApp::PaxosBasic;
    use Moose;
    
    with qw(Algorithm::Paxos::Role::Proposer);
    
    1;
    __END__

DESCRIPTION ^

From Wikipedia

    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.

METHODS ^

acceptors ( ) : @acceptors

Returns a list of the acceptors.

acceptor_count ( ) : $count

Returns count of the number of acceptors.

is_quorum ( @replies ) : $bool

Takes a list of IDs and sees if they meet a quorum.

highest_proposal_id ( @replies ) : $id

Takes a list of replies and returns the highest proposal id from the list.

new_proposal_id ( ) : $id

Generates a new proposal id. The default implementation is an increasing integer (literally $i++).

prospose ( $value ) : $id

Propose is the main interface between clients and the Paxos cluster/node. Propose takes a single value (the proposal) and returns the ID that is assigned to that proposal. If the proposal fails an exception is thrown.

AUTHOR ^

Chris Prather <chris@prather.org>

COPYRIGHT AND LICENSE ^

This software is copyright (c) 2012 by Chris Prather.

This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.

syntax highlighting: