how do i create a non-blocking asynchronous function in node.js?

前端 未结 10 944
悲&欢浪女
悲&欢浪女 2020-12-02 13:27

How do I create a non-blocking asynchronous function? Below is what I\'m trying to achieve but my program is still blocking...

var sys = require(\"sys\");

f         


        
10条回答
  •  时光取名叫无心
    2020-12-02 14:09

    setTimeout will not create a new thread, so the browser will still hang at the infinite loop.

    You need to rethink your program structure.

提交回复
热议问题