elixir_leaderboard v0.1.2 API Reference

Modules

Entry is the tuple-based structure that you send into the leaderboard

Use this storage engine to get efficient leaderboards powered by ets. Supports client/server mode via ElixirLeaderboard.Leaderboard.start_link/1 and ElixirLeaderboard.Leaderboard.async_populate/2. This is the default storage engine

Indexer walks the entire leaderboard and calculates the needed stats, such as rank and percentile

This module is full of functions that can be used in a custom indexer. Each uses a different way of calculating stats. Do you want your ranks to go sequentially, like 1, 1, 2? Then choose one of the sequential_rank_* functions. Want them offset instead, like 1, 1, 3? Choose one of the offset_rank_* functions. If there is something else you want to do that isn't available here, you are welcome to implement your own function

Leaderboard is a lightweight database designed to optimize storing and sorting data based on ranked scores. It has the following abilities

Record is the tuple-based structure that you get back when querying a leaderboard. In addition to the stored entry it also carries stats like rank and percentile

Use this storage engine to get efficient leaderboards powered by Redis

Use this behaviour to implement your own leaderboard storage engines

Use this storage engine to make small size one-off leaderboards that are stored entirely in a variable. Useful for leaderboards scoped to small groups of participants