I have always seen the keywords async used in Silverlight but was wondering if there is someone with a dummy's explanation of what it is and when to use it and its benefits. Please if you can explain, will be greatly appreciative. Thank you.
An async function is a function declared with the async keyword, and the await keyword is permitted within it. The async and await keywords enable asynchronous, promise-based behavior to be written in a cleaner style, avoiding the need to explicitly configure promise chains.
The async keyword turns a method into an async method, which allows you to use the await keyword in its body. When the await keyword is applied, it suspends the calling method and yields control back to its caller until the awaited task is complete. await can only be used inside an async method.
“async” keyword needs to be updated in front of functions that contain ”await” keyword to notify that the result might be available after a certain delay since we are explicitly making the main thread wait until the promise has been resolved. Await and Async has introduced synchronous behavior to the Execution.
In computer programming, the async/await pattern is a syntactic feature of many programming languages that allows an asynchronous, non-blocking function to be structured in a way similar to an ordinary synchronous function.
Start with my introductory article in MSDN magazine.
And then read the papers on the async CTP site.
And then read these fifteen articles:.
If you still have questions after all that, try asking at the async forum.
Have a look at this blog post, it gives a nice introduction and explanation of what async and await are.
If you want to really understand it, have a look at Jon Skeet's series on async and await
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With