Expand description
Implement half of log rate-limiting: the ability to cause the state of a Loggable to get flushed at appropriate intervals.
Modules§
- rt 🔒
- Declare a dyn-safe trait for the parts of an asynchronous runtime so that we can install it globally.
Structs§
- Inner 🔒
- The mutable state of a
RateLim
. - RateLim
- A rate-limited wrapper around a [
Loggable
]` that ensures its events are flushed from time to time.
Constants§
- RESET_
AFTER_ 🔒DORMANT_ FOR - After approximately this many seconds of not having anything to report, we should reset our timeout schedule.
Functions§
- run 🔒
- Helper: runs in a background task, and periodically flushes the
Loggable
inratelim
. Exits after [Loggable::flush
] returns [Activity::Dormant
] for “long enough”. - timeout_
sequence 🔒 - Return an iterator of reasonable amounts of time to summarize.