Asynchronous
Let's discuss asynchronous programming.
What’s asynchronous programming?
Asynchronous programming enhances the responsiveness of applications by using non-blocking operations to prevent bottlenecks that could slow down or freeze an application. The two main components of asynchronous programming are the keyword modifiers, async
and await
.
A method using the async
modifier enables the use of the await
operator, which now must be included at least once within the method. The original caller method continues when the await
operator is reached, and the async
method processes until it’s completed.
The async
methods must have a return type of void
, Task, Task<T>
, or any other type that has a GetAwaiter
method. The naming convention for async methods is to append them with an async
suffix.
Get hands-on with 1400+ tech skills courses.