Key pieces to understand Async and await
- Async code can be used for both I/O-bound and CPU-bound code, but differently for each scenario.
- Async code uses
Task<T> and Task, which are constructs used to model work being done in the background. - 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.
0 comments:
Post a Comment
Note: only a member of this blog may post a comment.