Async/Await
noun
say it: “AY-sink uh-WAYT” /ˈeɪsɪŋk əˈweɪt/
C# keywords that let a method wait for slow work, such as a web call, without blocking its thread.
What is Async/Await in C#?
Async/Await — Language features for pausing asynchronous work without blocking its thread.
class OrderService
{
async Task<string> LoadAsync(CancellationToken token)
{
await Task.Delay(100, token);
return "Ready";
}
}
In a sentence
- “With async/await, the API call doesn't freeze the app while it waits.”
Level: Master · More C# terms at this level
Updated