[Node.js] Processing Model

[Node.js] Processing Model

Node.js는 Event-Based Asynchronous I/O Framework

Event-Based

Client가 Application에게 request request를 event로 변환, event queue로 push event queue에서 pop, event를 하나씩 exectue(single thread) 바로 처리 가능하면 client에게 response

Asynchronous I/O

Event Loop에서 바로 처리할 수 없는 경우 (Disk read, External network connection) Non-blocking Worker (C++)에게 Event 넘김

(Disk read, External network connection) (C++)에게 Event 넘김 Non-blocking Worker에서 job이 처리 되면 Event queue에 전달

참고

노드 개발자가 IO 작업을 시작하면 무슨일이 일어날까?

from http://mskim9967.tistory.com/74 by ccl(S) rewrite - 2021-09-04 13:00:07