Partager via


AsyncReaderWriterResourceLock<TMoniker,TResource>.ResourceReleaser.GetResourceAsync Method

Definition

Gets the lock protected resource.

public System.Threading.Tasks.Task<TResource> GetResourceAsync (TMoniker resourceMoniker, System.Threading.CancellationToken cancellationToken = default);
member this.GetResourceAsync : 'Moniker * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Resource (requires 'Resource : null)>
Public Function GetResourceAsync (resourceMoniker As TMoniker, Optional cancellationToken As CancellationToken = Nothing) As Task(Of TResource)

Parameters

resourceMoniker
TMoniker

The identifier for the protected resource.

cancellationToken
CancellationToken

A token whose cancellation signals lost interest in the protected resource.

Returns

Task<TResource>

A task whose result is the resource.

Applies to