Still, because he's wise, Santa decides that instead of waiting for each elf to finish preparing a gift (that is, working synchronously), he will continue translating and passing out instructions from his pile of letters.Īs he is just about to read another letter, Red informs Santa that he has completed This year, due to the COVID-19 pandemic, only half Santa's elves can come to his workshop to help. He will then figure out the requested gift, translate the item name into the Elvish language, and then pass the instruction to each of our hard working elves who have different specialisations: wooden toys for Red, stuffed toys for Blue, and robotic toys for Green. Before any work can begin, Santa will have to read each of the lovely letters from kids around the world. To understand the default async processing model of Node.js, let's have a look at a hypothetical Santa's workshop. Instead, it continues on to subsequent tasks and only comes back to those previous external parties once it's gotten a signal of a result. Here's a TL DR description: in an async processing model, when your application engine interacts with external parties (like a file system or network), it doesn't wait until getting a result from those parties. So what exactly is the asynchronous processing model, or the non-blocking I/O model (which you've likely heard of if you're a Node.js user)? For the majority of us, learning asynchronous programming looks pretty much like this If your first time working with async wasn't like this, please consider yourself a geniusĪs hard as it is to pick up, async programming is critical to learn if you want to use JavaScript and Node.js to build web applications and servers – because JS code is asynchronous by default. One of the hardest concepts to wrap your head around when you're first learning JavaScript is the asynchronous processing model of the language.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. Archives
January 2023
Categories |