lundi 24 juin 2019

Is nodejs representing Reactor or Proactor design pattern?

Many articles online demonstrates NodeJS as an example of reactor pattern. Isn't it rather proactor?

As far as I understand, the difference between the two is:

  1. reactor handles events in a single thread (synchronously)
  2. proactor handles events is multiple threads (asynchronously) with completion callbacks.

For example in this article:

Reactor Pattern is an idea of non-blocking I/O operations in Node.js. This pattern provides a handler(in case of Node.js, a callback function) that is associated with each I/O operation. When an I/O request is generated, it is submitted to a demultiplexer.

Isn't it actually definition of proactor?

Aucun commentaire:

Enregistrer un commentaire