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
I'm using this inside of an AWS lambda for rate limiting during execution, one of the issues is we would like to reset state between runs as we do limiter.counts() to log the number of jobs that executed during the run.
We've worked around it by exporting a proxy object that lets us replace the bottleneck instance:
exports.handler=()>{limiter.reset();// Do stuffconsole.log(limiter.counts());}
Ideally this could be done from the Bottleneck instance itself so we can keep a clean reference as Proxying like this creates other problems as event handlers and such don't work as expected. Extending bottleneck and attempting to clean out internal state means keeping track of internal changes to this library.
The text was updated successfully, but these errors were encountered:
I'd like to second this. I'm using Bottleneck to limit the rate images are loaded from an IPFS gateway in response to a search. When a new search is entered, I need to stop loading the old results.
It'd be nice to be able to call a method and clear the job queue.
Hello,
I'm using this inside of an AWS lambda for rate limiting during execution, one of the issues is we would like to reset state between runs as we do
limiter.counts()
to log the number of jobs that executed during the run.We've worked around it by exporting a proxy object that lets us replace the bottleneck instance:
Then in our application we do:
Ideally this could be done from the Bottleneck instance itself so we can keep a clean reference as Proxying like this creates other problems as event handlers and such don't work as expected. Extending bottleneck and attempting to clean out internal state means keeping track of internal changes to this library.
The text was updated successfully, but these errors were encountered: