JS - Async API

anonymous·2021년 9월 11일
0

ASYNC API

  • Using non-blocking asynchronous APIs is even more important on Node than in the browser because Node is a single-threaded event-driven execution environment.
  • "Single threaded" means that all requests to the server are run on the same thread (rather than being spawned off into separate processes).

SYNC ACTION

console.log('First');
console.log('Second');

ASYNC ACTION

setTimeout(function() {
   console.log('First');
   }, 3000);
console.log('Second');

REF

https://developer.mozilla.org/en-US/docs/Learn/Server-side/Express_Nodejs/Introduction

profile
기술블로거입니다

0개의 댓글