C# Class Microsoft.Async.Transformations.DisposableAsyncFunction

A wrapper for an async factory and disposable.
Inheritance: IDisposable
Show file Open project: rozele/Microsoft.Async.Transformations Class Usage Examples

Public Methods

Method Description
DisposableAsyncFunction ( Task>.Func asyncFunction, IDisposable disposable ) : System

Instantiates a DisposableAsyncFunction.

Dispose ( ) : void

Disposes the IDisposable provided in the constructor.

InvokeAsync ( CancellationToken token ) : Task

Invokes the asynchronous function provided in the constructor.

Method Details

DisposableAsyncFunction() public method

Instantiates a DisposableAsyncFunction.
public DisposableAsyncFunction ( Task>.Func asyncFunction, IDisposable disposable ) : System
asyncFunction Task>.Func An asynchronous function.
disposable IDisposable A disposable.
return System

Dispose() public method

Disposes the IDisposable provided in the constructor.
public Dispose ( ) : void
return void

InvokeAsync() public method

Invokes the asynchronous function provided in the constructor.
public InvokeAsync ( CancellationToken token ) : Task
token System.Threading.CancellationToken /// A token to cancel the asynchronous request. ///
return Task