Class Command
Represents extension methods to work with commands.
Inherited Members
Namespace: DotNext.Net.Cluster.Consensus.Raft.Commands
Assembly: DotNext.Net.Cluster.dll
Syntax
public static class Command
Methods
| Edit this page View SourceAppendAsync<TCommand>(IPersistentState, TCommand, object?, CancellationToken)
Appends a strongly typed command to the log tail.
Declaration
public static ValueTask<long> AppendAsync<TCommand>(this IPersistentState state, TCommand command, object? context = null, CancellationToken token = default) where TCommand : ICommand<TCommand>
Parameters
Type | Name | Description |
---|---|---|
IPersistentState | state | The log. |
TCommand | command | The command to append. |
object | context | The optional context to be passed to the state machine. |
CancellationToken | token | The token that can be used to cancel the operation. |
Returns
Type | Description |
---|---|
ValueTask<long> | The index of the added command within the log. |
Type Parameters
Name | Description |
---|---|
TCommand | The type of the command. |