express icon indicating copy to clipboard operation
express copied to clipboard

How to hold a response? And are there something called "maxHeldResponseCount"?

Open HaloWang opened this issue 2 years ago • 1 comments

  1. I want to implement a long-polling model in my server (express.app).
  2. I use a map to stored incoming response, waiting (about 60 seconds later) another request to finally send stored response back.
  3. 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:

  1. Is it a right method for me to store response from app.post to implement long-polling?
  2. Does express.js itself set max concurrent count of held responses?

HaloWang avatar Apr 10 '22 09:04 HaloWang

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.

dougwilson avatar Apr 27 '22 23:04 dougwilson