0

Is there a way of getting access to the fastify request queue in NodeJS? And also knowing when each request in the queue has been disconnected from the sender?

Thanks in advance!

  • What do you mean with "request queue"? – Manuel Spigolon Sep 01 '20 at 10:30
  • The http request queue - so if I send 1000 requests asynchronously to the nodejs server - can I see how many requests are in the request queue at a given time? – Steve Day Sep 01 '20 at 12:33
  • No, there is not a queue under the hood: queue would mean that the request are processed sequentially, but it is not so. What are you trying to archive? – Manuel Spigolon Sep 01 '20 at 13:03
  • No worries - I have a nodejs server that has a worker pool converting mjml payloads to html consuming an input queue and a http server for incoming requests. If there are http requests outstanding - I want to stop the input queue processing whilst the http requests are process and then resume when the http request queue is 0 – Steve Day Sep 01 '20 at 14:17
  • Would be fine using a `child_process`? Otherwise you need to write your own logic using `onRequest` and `onResponse` hooks – Manuel Spigolon Sep 01 '20 at 16:11

0 Answers0