CHAPTER 30

image

Asynchronous methods

An asynchronous method is a method that can return before it has finished executing. Any method that performs a potentially long running task, such as accessing a web resource or reading a file, can be made asynchronous to improve the responsiveness of the program. This is especially important in graphical applications, because any method that takes a long time to execute on the user interface thread will cause the program to be unresponsive while waiting for that method to complete.

Async and await

Introduced in C# 5.0, the async and await keywords allow asynchronous methods to be written with a simple structure ...

Get C# Quick Syntax Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.