requests on same route working like a queue #4820
Answered
by
micalevisk
malletgaetan
asked this question in
Q&A
-
¿ problem ?Hello everyone! Just observed that multiple request for the same path were always finished in the same order than they came in. For example:
questionIf a client make a request that take a LOT of time to finish, how to prevent other clients requesting the same route from being blocked? codeimport express from 'express'
const app = express()
app.get('/', function(req, res){
setTimeout(() => res.send("Hello world!"), 2000)
})
app.get('/test', function(req, res){
setTimeout(() => res.send("Hello world!"), 2000)
})
app.listen(3000) Thanks! ✌(-‿-)✌ |
Beta Was this translation helpful? Give feedback.
Answered by
micalevisk
Feb 12, 2022
Replies: 1 comment 7 replies
-
by not blocking the event loop, I guess? |
Beta Was this translation helpful? Give feedback.
7 replies
Answer selected by
malletgaetan
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
by not blocking the event loop, I guess?