Click or drag to resize
IAsyncDisposableDisposeAsync Method
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

Namespace: Rackspace.Threading
Assembly: Rackspace.Threading (in Rackspace.Threading.dll) Version: 2.1.0-beta1
Syntax
Task DisposeAsync()

Return Value

Type: Task
A Task representing the asynchronous operation.
Remarks

This method should perform the same operation as Dispose, with the following key differences.

  • The DisposeAsync method should never be called from a finalizer.
  • The DisposeAsync method will not be called automatically from a using block, even when that block is located within an method. The Using Overload methods provide support for the IAsyncDisposable interface in a manner resembling the behavior proposed in IAsyncDisposable, using statements, and async/await.
Note Notes to Implementers

To prevent finalization of the object while an asynchronous dispose operation is ongoing, the Task returned by this method should retain a reference to the object until the operation is complete.

Version Information

.NET for Windows Store apps

Supported in: Windows 8

.NET Framework

Supported in: 4.5, 4.0, 3.5

Portable Class Library

Supported in: Portable Class Library (Legacy), Portable Class Library

Threading Library

Supported in: 2.1, 2.0, 1.1, 1.0
See Also