I need to run a server handler in single thread mode.
I see that when a request is sent to that handler, and the previous execution is not finished yet, the second request is paused until the first one is done.
How can I count how many requests are waiting to be executed?
A counter inside the handler is not useful, since the handled is not called until the previous one is running.
making a long story short: converting existing code to server.
the existing code requires massive rewrite to remove global objects dependencies, so the quick solution is using it single-threaded, while rewrite is planned but not imminent
the existing code requires massive rewrite to remove global objects dependencies, so the quick solution is using it single-threaded, while rewrite is planned but not imminent