问题
Asynchronous programming is the next up-and-coming paradigm... or so it seems. I have been programming in Node.js for the past few months and have been learning to write code this way. I have a coworker who works in Silverlight and I have been trying to teach him how to use the TPL. I have also been showing him the "await" keyword and how it works.
After a while, using callbacks becomes pretty normal. In Node.js, I am using the caolan/async project to avoid deeply nested callbacks. I have taken a peek at the source code, but it is like reading the STL for the very first time.
Even though I have learned a lot of techniques that work in this environment, I worry I am missing others. I was curious if there were any reading materials/videos that explained async programming techniques and how to build an async library like the TPL or caolan/async.
Just trying to master the paradigm before it's everywhere.
回答1:
Well even though I know most of Async source code and how does it work, but I still use async mostly. So don't worry about that, you don't need to know exactly how it works. But as of learning, well I suggest you to read these articles:
- http://book.mixu.net/node/ch7.html
- http://stella.laurenzo.org/2011/03/bulletproof-node-js-coding/
- http://howtonode.org/promises
- http://web.archive.org/web/20120111150910/http://nodebits.org/distilled-patterns?
- http://raynos.github.com/presentation/shower/controlflow.htm (from Raynos comment)
These are the best things that I've seen on the net explaining async control flow at without any abstractions.
来源:https://stackoverflow.com/questions/9355240/reading-material-on-async-programming-practices