TaskBuilder Module

Contains the `task` computation expression builder.

Functions and values

Function or value Description


Full Usage: backgroundTask

Returns: BackgroundTaskBuilder

Builds a task using computation expression syntax which switches to execute on a background thread if not already doing so.

If the task is created on a foreground thread (where SynchronizationContext.Current is non-null) its body is executed on a background thread using Task.Run. If created on a background thread (where SynchronizationContext.Current is null) it is executed immeidately immediately on that thread.

Returns: BackgroundTaskBuilder


Full Usage: task

Returns: TaskBuilder

Builds a task using computation expression syntax.

Returns: TaskBuilder