Skip to content
This repository has been archived by the owner on Feb 1, 2023. It is now read-only.

Debounce wants #245

Closed
dirkmc opened this issue Jan 31, 2020 · 0 comments · Fixed by #255
Closed

Debounce wants #245

dirkmc opened this issue Jan 31, 2020 · 0 comments · Fixed by #255

Comments

@dirkmc
Copy link
Contributor

dirkmc commented Jan 31, 2020

Currently we debounce sending wants by a millisecond. If a client sends continuous requests at a higher frequency than the debounce time, the request will never be sent.

Proposed Solution:
Add a debounce function to the message queue that takes two parameters:

  • debounce time
    wait at least this interval after the last invocation before calling the target function
  • max time
    if we're still debouncing after this amount of time, don't wait any more, call the target function anyway
Stebalien added a commit that referenced this issue Feb 13, 2020
This:

* Makes it easy to send immediately if we wait too long and/or if we have enough
to send.
* Is significantly more efficient than the debounce library as it doesn't spin
off a bunch of "after" timers.

fixes #245
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
1 participant