Photomechanics API
TaskCompletionSourceExtensions Class Reference

Extensions for TaskCompletionSource. More...

Static Public Member Functions

static IDisposable AsDisposable (this TaskCompletionSource tcs)
 Return disposable token which will try to complete provided TaskCompletionSource when disposed. Useful to make code like More...
 

Detailed Description

Extensions for TaskCompletionSource.

Member Function Documentation

◆ AsDisposable()

static IDisposable TaskCompletionSourceExtensions.AsDisposable ( this TaskCompletionSource  tcs)
static

Return disposable token which will try to complete provided TaskCompletionSource when disposed. Useful to make code like

finally { taskCompletionSource.Complete(); } more concise.