Interface IStateMachine
Represents state machine.
Inherited Members
Namespace: DotNext.Net.Cluster.Consensus.Raft.StateMachine
Assembly: DotNext.Net.Cluster.dll
Syntax
public interface IStateMachine : ISnapshotManager
Methods
| Edit this page View SourceApplyAsync(LogEntry, CancellationToken)
Applies the log entry to the underlying state machine.
Declaration
ValueTask<long> ApplyAsync(LogEntry entry, CancellationToken token)
Parameters
Type | Name | Description |
---|---|---|
LogEntry | entry | The log entry to be applied. |
CancellationToken | token | The token that can be used to cancel the operation. |
Returns
Type | Description |
---|---|
ValueTask<long> | The index of the last applied log entry. It should be greater than or equal to Index. |
Remarks
This method is never called concurrently by WriteAheadLog infrastructure. However, it can be called concurrently with Snapshot or ReclaimGarbageAsync(long, CancellationToken) methods. The implementation can create a new snapshot on the disk. In this case, it should replace the current snapshot and Snapshot will return newly generated snapshot.
Exceptions
Type | Condition |
---|---|
OperationCanceledException | The operation has been canceled. |