Rate limiting moderator to prevent message flooding.
Uses ETS to track message counts per sender within a time window.
Options
:max_messages- Maximum messages allowed in window (default: 10):window_ms- Time window in milliseconds (default: 60_000 = 1 minute):table- ETS table name for tracking (default: :jido_messaging_rate_limits)
Example
RateLimiter.moderate(message, max_messages: 5, window_ms: 30_000)
Summary
Functions
Get current message count for a sender within the window.
Initialize the rate limiter ETS table.
Reset rate limit counters for a sender.
Functions
Get current message count for a sender within the window.
Initialize the rate limiter ETS table.
Call this during application startup if you want to control table creation.
Reset rate limit counters for a sender.