Partilhar via


HiLoValueGeneratorState.NextAsync<TValue> Método

Definição

Obtém um valor a ser atribuído a uma propriedade .

public virtual System.Threading.Tasks.Task<TValue> NextAsync<TValue> (Func<System.Threading.CancellationToken,System.Threading.Tasks.Task<long>> getNewLowValue, System.Threading.CancellationToken cancellationToken = default);
public virtual System.Threading.Tasks.ValueTask<TValue> NextAsync<TValue> (Func<System.Threading.CancellationToken,System.Threading.Tasks.Task<long>> getNewLowValue, System.Threading.CancellationToken cancellationToken = default);
abstract member NextAsync : Func<System.Threading.CancellationToken, System.Threading.Tasks.Task<int64>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Value>
override this.NextAsync : Func<System.Threading.CancellationToken, System.Threading.Tasks.Task<int64>> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<'Value>
abstract member NextAsync : Func<System.Threading.CancellationToken, System.Threading.Tasks.Task<int64>> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<'Value>
override this.NextAsync : Func<System.Threading.CancellationToken, System.Threading.Tasks.Task<int64>> * System.Threading.CancellationToken -> System.Threading.Tasks.ValueTask<'Value>
Public Overridable Function NextAsync(Of TValue) (getNewLowValue As Func(Of CancellationToken, Task(Of Long)), Optional cancellationToken As CancellationToken = Nothing) As Task(Of TValue)
Public Overridable Function NextAsync(Of TValue) (getNewLowValue As Func(Of CancellationToken, Task(Of Long)), Optional cancellationToken As CancellationToken = Nothing) As ValueTask(Of TValue)

Parâmetros de tipo

TValue

O tipo de valores que estão sendo gerados.

Parâmetros

getNewLowValue
Func<CancellationToken,Task<Int64>>

Uma função para obter o próximo valor baixo, se necessário.

cancellationToken
CancellationToken

Um CancellationToken a ser observado enquanto aguarda a conclusão da tarefa.

Retornos

Task<TValue>
ValueTask<TValue>

O valor a ser atribuído a uma propriedade .

Exceções

Se o padrão CancellationToken for cancelado.

Aplica-se a