HiLoValueGeneratorState HiLoValueGeneratorState Class

Definition

The thread safe state used by HiLoValueGenerator<TValue>.

public class HiLoValueGeneratorState
Public Class HiLoValueGeneratorState
Inheritance
System.ObjectSystem.Object
HiLoValueGeneratorStateHiLoValueGeneratorState

Constructors

HiLoValueGeneratorState(Int32) HiLoValueGeneratorState(Int32)

Initializes a new instance of the HiLoValueGeneratorState class.

public HiLoValueGeneratorState(int blockSize)
Public Sub New(blockSize As Integer)
Parameters
blockSize
System.Int32 System.Int32

The number of sequential values that can be used, starting from the low value, before a new low value must be fetched from the database.

Methods

Equals(Object) Equals(Object)

Inherited from System.Object

Equals(Object, Object) Equals(Object, Object)

Inherited from System.Object

GetHashCode() GetHashCode()

Inherited from System.Object

GetType() GetType()

Inherited from System.Object

MemberwiseClone() MemberwiseClone()

Inherited from System.Object

Next(Func) Next(Of TValue)(Func(Of Int64))

Gets a value to be assigned to a property.

public virtual TValue Next<TValue>(Func<long> getNewLowValue)
Public Overridable Function Next(Of TValue)(getNewLowValue As Func(Of Long)) As TValue
Type Parameters
TValue

The type of values being generated.

Parameters
getNewLowValue
System.Func<System.Int64> System.Func(Of System.Int64)

A function to get the next low value if needed.

Returns
TValue TValue

The value to be assigned to a property.

NextAsync(Func>, CancellationToken) NextAsync(Of TValue)(Func(Of CancellationToken, Task(Of Int64)), CancellationToken)

Gets a value to be assigned to a property.

public virtual Task<TValue> NextAsync<TValue>(Func<CancellationToken, Task<long>> getNewLowValue, CancellationToken cancellationToken = null)
Public Overridable Function NextAsync(Of TValue)(getNewLowValue As Func(Of CancellationToken, Task(Of Long)), cancellationToken As CancellationToken = Nothing) As Task(Of TValue)
Type Parameters
TValue

The type of values being generated.

Parameters
getNewLowValue
System.Func<System.Threading.CancellationToken, System.Threading.Tasks.Task<System.Int64>> System.Func(Of System.Threading.CancellationToken, System.Threading.Tasks.Task(Of System.Int64))

A function to get the next low value if needed.

cancellationToken
System.Threading.CancellationToken System.Threading.CancellationToken

A System.Threading.CancellationToken to observe while waiting for the task to complete.

Returns
System.Threading.Tasks.Task<TValue> System.Threading.Tasks.Task(Of TValue)

The value to be assigned to a property.

ReferenceEquals(Object, Object) ReferenceEquals(Object, Object)

Inherited from System.Object

ToString() ToString()

Inherited from System.Object