The reactor pattern is used for maintaining non-blocking I/O operations in Node.js. It attaches a callback function (a handler) to each I/O operation. The handler is then submitted to a demultiplexer at the time of request creation.
Demultiplexer collects every I/O request made in the application and queues them as events in a queue. This is what we call the event queue. After queuing the event, the demultiplexer returns the control of the application thread.
Meanwhile, the event loop iterates over each event in the event queue, and invokes the attached callback to handle the event response.
This is the reactor pattern used by Node.js.