You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Aug 24, 2019. It is now read-only.
I was wondering what the thoughts were behind not providing a block parameter to the execute function of the DebouncedLimiter like TimedLimiter? I wanted to do something like this:
let refreshTimeline = DebouncedLimiter(limit: 5)
refreshTimeline.execute {
// Do some work that only runs last block per 5 seconds.
}
..Also let's me fully encapsulate debouncers in extensions without stored properties or force unwrapping:
extension ViewController {
private static var refreshTimelineLimiter = DebouncedLimiter(limit: 5)
func refreshTimeline() {
ViewController.refreshTimelineLimiter.execute {
// Do some work that only runs last block per 5 seconds.
}
}
}
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Great library btw, thanks for sharing this!
I was wondering what the thoughts were behind not providing a block parameter to the execute function of the
DebouncedLimiter
likeTimedLimiter
? I wanted to do something like this:I have extended this in my fork to do this, but wanted to get your thoughts before creating a PR in case there's something I'm missing: https://github.com/basememara/RateLimit/commit/763a1b60fdc5884b70540cbb1c58aff6874a68b9
The text was updated successfully, but these errors were encountered: