Replies: 1 comment
-
|
This is a bit tricky. I believe I had to change the AsyncThrottler to wait for settled promises in order to get rid of race conditions, but for the other async utils, they still mostly consider execution start times. This could get complex, but is worth exploring to get right. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
When using the async versions of the utilities, having the window start on promise settled would allow for representing a "limit from last execution" type of behaviour instead of the current "limit from last triggered". It would also help to separately handle pending and limit-exceeded states when used alongside a mutation.
One example use-case I can think of is rate-limiting an expensive API call to 1 per minute. If we say the API call take 10 seconds from network delay, the rate-limiter would allow for another call in 50 seconds of the last execution being settled.
Beta Was this translation helpful? Give feedback.
All reactions