Skip to content

The Tasks class

kobi2294 edited this page Apr 22, 2019 · 1 revision

The Tasks class

This static class provides a set of TPL related shortcuts and extension methods.

  • Tasks.Empty - returns a completed task
  • Tasks.True - returns a completed boolean task with the result true
  • Tasks.False - returns a completed boolean task with the result false
  • ToTask<T> Extension method - creates a completed Task<T> with the source as result
  • ToDeferredTask<T> Extension method - creates an in progress DeferredTask<T> with the source as result.
  • ToContextRunner Extension method - converts a TaskScheduler to Context Runner.
Clone this wiki locally