continuation
The rest of a method that is scheduled to run once an awaited task completes.
In more detail
Continuations are how async code resumes without keeping a thread blocked in the meantime. When a task has not finished, await registers the continuation and returns to the caller, freeing the thread; the continuation later resumes on the line after the await.
Related terms
- async and await — Language keywords for writing code that waits for slow work, such as a network call, without blocking a thread.
- state machine — A model in which something is always in exactly one named state, such as idle, loading, success or error, and only defined events move it to another.
- Task — The .NET type representing an operation that may still be running and will eventually complete with a result, an exception or cancellation.
Taught in
- Async and Await: Managing Concurrency — Modern .NET Core, C# & Enterprise Microservices