Comments (6)
Thank you, this is great, I'll have a look as soon as I can.
from bottleneck.
All queued up and scheduled jobs are always cleared.
For the running jobs, there are 2 settings that matter:
interrupt
:stopAll()
argumentrejectOnDrop
: argument passed when creating the limiter
- If
interrupt
isfalse
: The running jobs are ignored. They will complete successfully or fail on their own and the results will be passed to the callers. - If
interrupt
istrue
andrejectOnDrop
istrue
: The running jobs will be rejected immediately with a failed promise. But the job itself keeps running in the background, because it's impossible to cancel function execution in JavaScript. When that job terminates, Bottleneck will ignore the result, since it has already returned a failed promise to the callers. - If
interrupt
istrue
andrejectOnDrop
isfalse
: the result of the running jobs will not be passed to the callers once they complete. The callers are simply left hanging.
I'm adding all of that information to the README, I hope it answered your questions.
from bottleneck.
Thank you for the detailed explanation.
I setup an example repo with all possible combinations of interrupt and rejectOnDrop to show what I am seeing:
https://github.com/chrisblossom/bottleneck-example
I am trying to clear the queue and letting whatever is running finish running as it normally would.
from bottleneck.
Hmm, something sticks out right away: you have the wrong number of arguments in your example.
Here you have 4 arguments and it's clear that you intended for the boolean to be rejectOnDrop
's setting.
The arguments are, in order:
maxConcurrent
(default0
)minTime
(default0
)highWater
(default-1
)strategy
(defaultBottleneck.strategy.LEAK
)rejectOnDrop
(defaultfalse
)
You can use null
instead of undefined
to skip an argument (and use the default).
Let me know if that fixes it, and if not I'll look it right away, I just came back from a trip.
from bottleneck.
Good catch! I just tried it with the correct amount of arguments and the issue is still there.
from bottleneck.
Closing this since it won't be an issue in v2, currently in beta.
from bottleneck.
Related Issues (20)
- Invalid job status RECEIVED, expected DONE HOT 1
- task.apply is not a function
- Any correct ways to do rate limit 1000 per hour?
- `light.d.ts` not published in npm package
- Throw error for invalid settings
- Would it be possible to add a reset() method to clear state on local instances? HOT 1
- ReplyError: ERR SETTINGS_KEY_NOT_FOUND when use in Clustering mode with Redis 7.x HOT 8
- Is bottleneck still maintained? HOT 11
- recovering for a crashed service using redis
- bottleneck lost tracing data when using reservoir options
- Redis errors with ReplyError: ERR UNKOWN_CLIENT HOT 7
- dynamic schedule / retry HOT 3
- Long delay in Bottleneck.schedule execution in a distributed env HOT 1
- Is there a way to pass different options for limiters within the same group?
- Is there a way to read and write the reservoir for a given limiter?
- Long-lasting limiters with matching cardinality to app's users
- ERR SETTINGS_KEY_NOT_FOUND with redis 7.0.7 HOT 11
- user_script:201: attempt to compare number with nil
- Warning from vite about using eval
- Retry behaviour
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from bottleneck.