javascript - When using the *sync functions in Node.js, what (if any) background operations continue to run -


when using node.js *sync functions (i understand shouldn't, , reasons why), (if any) background processes continue run?

for example, if i'm using http.createserver, , 1 of requests call fs.writefilesync(), server continue serve new clients whilst write in progress (not accept connection, process entire request)? i.e. writefilesync() block entire process, or current call chain?

basically effect of using *sync function block process long-running javascript does. running *sync, means when process waiting them complete sits , nothing. if use asynchronous counter part of functions, when process waiting them complete , handle other pending events such new http requests handled.

if have http server running , call *sync function, when *sync function running new http requests in time queued handled after current javascript , *sync function has finished executing.

here's quote node documentation:

in busy processes, programmer encouraged use asynchronous versions of these calls. synchronous versions block entire process until complete--halting connections.


Comments

Popular posts from this blog

how to proxy from https to http with lighttpd -

android - Automated my builds -

python - Flask migration error -