class RLS::Memory::Leaderboard

Overview

Cache for leaderboards, which are arrays of players associated with a particular stat type or game mode. Leaderboards are valid (server-side) for EXPIRY_TIME, as described in the RLS documentation.

TODO prune method

Defined in:

rls/cache.cr

Constant Summary

EXPIRY_TIME = 15.minutes

The duration to hold onto leaderboards for

Instance Method Summary

Instance Method Detail

def cache(type : RLS::REST::StatType | RLS::REST::RankedPlaylist, players : Array(RLS::Player)) #

Stores a leaderboard in the cache


[View source]
def resolve(type : RLS::REST::StatType | RLS::REST::RankedPlaylist) : Array(RLS::Player) | Nil #

Resolves a leaderboard from the cache. Returns nil if the stored leaderboard is due for an update.


[View source]