Use promise query in node interface?

promsie solves the problem of asynchronous callback nesting, but will the use of promsie cause blocking?
Interface Asynchronous Writing:

app.use("/test",function(req,res){
 fn() 
}

fn is an asynchronous query database function. Because fn is asynchronous, the code will not wait here. If there are multiple requests at the same time, the next request will not wait for fn to finish execution before accessing the execution. Node can quickly access multiple requests.
write API with async:

app.use("/test",function(req,res){
   async fn(){
   let res=await fn1()
   let res1=await fn2(res)
   res.send(res1)
   }
fn()
}

at this time, the fn becomes Synchronize, and the next request must wait for the previous request to be processed before it is accessed. If there are too many requests, will it cause blocking, resulting in a long waiting time for later requests? At present, many people use promsie to write encapsulation interfaces, will it cause the above problems? Or do I misunderstand?

Apr.12,2021

blocking is impossible, not for the rest of your life.
intuitive async / await blocking is only because the callback has not been executed, but the callback has not been executed, and the subsequent res.send will not be executed, resulting in the request going unanswered.

await , async are just used to help you better handle Promise . CPU does not always wait for the Promise to change state after await on this request. The
is going to do something else first, and here's the EventLoop .

async await is still asynchronous, asynchronous, asynchronous. It just looks like Synchronize

just wrote an article a few days ago. You can take a look at it a little bit: https://codeshelper.com/a/11.

.
Menu