express
express copied to clipboard
How to hold a response? And are there something called "maxHeldResponseCount"?
- I want to implement a long-polling model in my server (express.app).
- I use a map to stored incoming response, waiting (about 60 seconds later) another request to finally send stored response back.
- I find the store action will block other incoming request. I mean, the callback of
app.post("xxx"...)
is not called until I close some of stored responses in step 2.
So, I wonder:
- Is it a right method for me to store response from
app.post
to implement long-polling? - Does express.js itself set max concurrent count of held responses?
Hi @HaloWang there should not be any issue holding on to the objects like thay. As for why your other requests are being blocked, I'm not sure. Express itself does not have any limitation on the number of max concurrent requests. We may need you to provide code and instructions to reproduce the issue so we can help debug.