alykoshin / express-queue Goto Github PK
View Code? Open in Web Editor NEWExpress middleware to limit a number of simultaneously processing requests using queue
License: MIT License
Express middleware to limit a number of simultaneously processing requests using queue
License: MIT License
Hello, tks for solution, i need use this section app.use(queue({ activeLimit: 1 }));
conditionally, its possible?
For my api /do/:something
I would like to allow only one request per value of something
.
For example:
/do/something
gets through/do/something
has to wait for first request to finish/do/somethingElse
gets throughThis is a simple example. The values for something
are unspecified values like uuid
s.
The module is not working for me very well.
Once the queue is empty, the server does not accept any request and I have to restart the process again.
I'm using "request" module to upload a file, compress using imagemin mozjpeg and then save to disk.
Any idea?
Please note that I'm using a for loop to send multiple request at once.
My queue limit is 2, for testing.
I'm using Windows 8.1, Node 8.9.1
Hello,
If I set up limits on 2 or more individual routes will they each have their own queue or will they all share one queue?
So if I have:
app.use('/products', queue({ activeLimit: 1 }) );
app.use('/services', queue({ activeLimit: 100 }) );
If I make one request to /products
that takes 5secs to complete - will users be blocked from /services
during that time?
I want to be able to manually tell express-queue if there is a member in the queue. That way, based on frontend code, I can tell express whether or not to let the next person in if my frontend code is still running.
Module is hanging when more jobs than specified are added to the queue. This is because there is no event listener for 'reject' like there is for 'process'
self.jobQueue.on('reject', function(job) {
console.log('Job rejected')
job.data.res.status(200).end()
});
It is already fixed in PR #5
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.