Condividi tramite


AsyncLazy<T>.GetValueAsync Metodo

Definizione

Overload

GetValueAsync()

Ottiene l'attività che produce o ha prodotto il valore.

GetValueAsync(CancellationToken)

Ottiene l'attività che produce o ha prodotto il valore.

GetValueAsync()

Ottiene l'attività che produce o ha prodotto il valore.

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)

Restituisce

Task<T>

Un'attività il cui risultato è il valore costruito in modo più pigre.

Eccezioni

Generato quando la value factory chiama GetValueAsync() questa istanza.

Generata dopo DisposeValue() la chiamata.

Si applica a

GetValueAsync(CancellationToken)

Ottiene l'attività che produce o ha prodotto il valore.

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)

Parametri

cancellationToken
CancellationToken

Token il cui annullamento indica che il chiamante non è più interessato al risultato. Si noti che questa operazione non annulla la factory dei valori (poiché altri chiamanti potrebbero esistere). Tuttavia, questo token comporterà un annullamento rapido dell'attività restituita e un'aggiunta di qualsiasi JoinableTask elemento che potrebbe essere stato generato in seguito a questa chiamata.

Restituisce

Task<T>

Un'attività il cui risultato è il valore costruito in modo più pigre.

Eccezioni

Generato quando la value factory chiama GetValueAsync() questa istanza.

Generata dopo DisposeValue() la chiamata.

Si applica a