Let's say we have 3 request(A,B,C) hitting our node.js server at the same time.
What will be node.js criteria to identify which request should be executed first of all?
One more thing all request are blocking operations.
Let's say we have 3 request(A,B,C) hitting our node.js server at the same time.
What will be node.js criteria to identify which request should be executed first of all?
One more thing all request are blocking operations.
AFAIK there is no such thing as exactly simultaneous requests - at least somewhere inside the network/transport layer the packets carrying those requests are serialized.
Which will make them reach the node server serialized as well. Their position in the request queue will reflect that serialization.
You may want to learn about node.js event loop. Also, check Anatomy of an HTTP transaction.