HiLoValueGeneratorState.NextAsync<TValue> 方法

定义

获取要分配给属性的值。

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)

类型参数

TValue

正在生成的值的类型。

参数

getNewLowValue
Func<CancellationToken,Task<Int64>>

如果需要,用于获取下一个低值的函数。

cancellationToken
CancellationToken

等待 CancellationToken 任务完成时要观察的 。

返回

Task<TValue>
ValueTask<TValue>

要分配给属性的值。

例外

适用于