The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.

NAME

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

VERSION

version 0.001

SYNOPSIS

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

DESCRIPTION

From Wikipedia

    Learners act as the replication factor for the protocol. Once a Client
    request has been agreed on by the Acceptors, the Learner may take action
    (i.e.: execute the request and send a response to the client). To improve
    availability of processing, additional Learners can be added.

METHODS

learn ( $id, $value )

This is the main interface between Acceptors and Leaners. When a value is choosen by the cluster, learn is passed the id and value and is recorded in stable storage. The default implementation stores everything in an in-memory HashRef.

proposal_ids ( ) : @ids

Returns a list of proposal ids.

proposal_count ( ) : $count

Returns the number of proposals to date.

latest_proposal ( ) : $value

Returns the value of the proposal with the greatest id.

Returns the value stored for $id.

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.

1 POD Error

The following errors were encountered while parsing the POD:

Around line 82:

Unknown directive: =meethod