AsyncLazy<T>.GetValueAsync Method

Definition

Overloads

GetValueAsync()

Gets the task that produces or has produced the value.

GetValueAsync(CancellationToken)

Gets the task that produces or has produced the value.

GetValueAsync()

Gets the task that produces or has produced the value.

public:
 System::Threading::Tasks::Task<T> ^ GetValueAsync();
public System.Threading.Tasks.Task<T> GetValueAsync ();
member this.GetValueAsync : unit -> System.Threading.Tasks.Task<'T>
Public Function GetValueAsync () As Task(Of T)

Returns

Task<T>

A task whose result is the lazily constructed value.

Exceptions

Thrown when the value factory calls GetValueAsync() on this instance.

Thrown after DisposeValue() is called.

Applies to

GetValueAsync(CancellationToken)

Gets the task that produces or has produced the value.

public:
 System::Threading::Tasks::Task<T> ^ GetValueAsync(System::Threading::CancellationToken cancellationToken);
public System.Threading.Tasks.Task<T> GetValueAsync (System.Threading.CancellationToken cancellationToken);
member this.GetValueAsync : System.Threading.CancellationToken -> System.Threading.Tasks.Task<'T>
Public Function GetValueAsync (cancellationToken As CancellationToken) As Task(Of T)

Parameters

cancellationToken
CancellationToken

A token whose cancellation indicates that the caller no longer is interested in the result. Note that this will not cancel the value factory (since other callers may exist). But this token will result in an expediant cancellation of the returned Task, and a dis-joining of any JoinableTask that may have occurred as a result of this call.

Returns

Task<T>

A task whose result is the lazily constructed value.

Exceptions

Thrown when the value factory calls GetValueAsync() on this instance.

Thrown after DisposeValue() is called.

Applies to