This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require "securerandom" | |
| class RollingCounter | |
| # :call-seq: RollingCounter.new(redis_client, max_window_seconds) -> counter | |
| # | |
| # Create a new counter instance, that will store/retrieve counts with | |
| # +redis_client+ and return counts within the last +max_window_seconds+ | |
| # seconds. | |
| # |