Have throttled worker always wait throttleDelay between work calls#229989
Have throttled worker always wait throttleDelay between work calls#229989
Conversation
|
I think this change would not be suitable for the case I created the vscode/src/vs/platform/files/node/watcher/parcel/parcelWatcher.ts Lines 176 to 183 in b591f33 |
|
Would it be worth a throttled worker option or do you think I should just use a different utility? Here's the PR where I try to consume this if interested. https://github.com/microsoft/vscode-copilot/pull/8758 |
|
Update, I've made a change to put this work in |
|
I did not create a test for it in my first PR because it modified the default behavior so instead I modified your existing tests. I will create a test for this and get another ✔️ since you did the cleanup. Thanks for the 💄 and review |
Consider the following case,
maxWorkChunkSizeof 1 and athrottleDelayof 1000ms. ThemaxBufferedWorkdoesn't matter here.This seems wrong as I don't want my work items to execute without a minimum 1000ms gap in between them. Instead even if the queue is empty, the throttled worker should ensure that the second queue task must wait 500ms before executing so it's been 1000ms since the last unit of work.
This does modify the text behavior slightly, so I am happy to make this an option on the worker options or something, but I was surprised when the worker did not work out of the box like this