fix comment

This commit is contained in:
Raycho Mukelov 2023-11-05 18:32:52 +02:00
parent 987f4efd99
commit d5312ec40a
1 changed files with 4 additions and 2 deletions

View File

@ -28,7 +28,9 @@ type
ClientRequestReceived,
ClientRequestProcessed
# Define callback to use with Terminals. Node states are updated/read in-place in the node object
# Define callback to use with transitions. It is a function that takes a node as an argument and returns nothing.
# It is used to perform some action when a transition is triggered. For example, when a node becomes a leader,
# it should start sending heartbeats to other nodes.
ConsensusFsmTransitionActionType*[NodeType] = proc(node: NodeType) {.gcsafe.}
# Define logical functions (conditions) computed from our NodeType etc. (Truth Table)
@ -61,7 +63,7 @@ type
proc new*[RaftNodeState, EventType, NodeType, RaftNodeStates](
T: type ConsensusFsm[RaftNodeState, EventType, NodeType, RaftMessageBase], startSymbol: RaftNodeState = rnsFollower): T =
result = new(ConsensusFsm[NodeType, EventType, RaftNodeStates])
result = ConsensusFsm[NodeType, EventType, RaftNodeStates]()
initRLock(result.mtx)
result.state = startSymbol
debug "new: ", fsm=repr(result)