Before I present a page, I have to encode several requests. Here's how I am doing it (db.js is my database processing level): I think that such Methos has killed Ascend's idea. However, after processing all the requests I must call res.render. How to start it async? Should I use the async library as told here: or is there a more suitable solution? Thank you. I think this kind of mathos killed Ascend's idea No, they do not do it properly that how Asynchronous I / O should work. However, I feel your pain while chaining multiple sync calls. Before you know this, you may have 6 or 7 nested anonymous async functions. Before I consider using such a library, I will use two parameters like ASCIN or promise. I hope this will help you make your decision db.findUser (objid, function (result1) {db.findAuthor (objid, function (Result2) {Db.findSmthElse (objid, function (result3) {res.render ('template', {user: result1, author: result2, smthelse: result2});});});});
No comments:
Post a Comment