Redis::LeaderBoardMulti - Redis leader board considering multiple scores
use Redis; use Redis::LeaderBoard; my $redis = Redis->new; my $lb = Redis::LeaderBoardMulti->new( redis => $redis, key => 'leader_board:1', order => ['asc', 'desc'], # asc/desc, desc as default ); $lb->set_score('one' => 100, time); $lb->set_score('two' => 50, time); my ($rank, $score) = $lb->get_rank_with_score('one');
Redis::LeaderBoardMulti is for providing leader board by using Redis's sorted set. Redis::LeaderBoard considers only one score, while Redis::LeaderBoardMulti can consider secondary score.
Copyright (C) Ichinose Shogo.
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
Ichinose Shogo <shogo82148@gmail.com>
To install Redis::LeaderBoardMulti, copy and paste the appropriate command in to your terminal.
cpanm
cpanm Redis::LeaderBoardMulti
CPAN shell
perl -MCPAN -e shell install Redis::LeaderBoardMulti
For more information on module installation, please visit the detailed CPAN module installation guide.