diff --git a/raft/consensus_module.nim b/raft/consensus_module.nim index 9b664c0..8ffc929 100644 --- a/raft/consensus_module.nim +++ b/raft/consensus_module.nim @@ -10,14 +10,30 @@ import protocol import types -proc RaftNodeConsensusStartElection*(consensus: RaftConsensusModule) = +proc RaftNodeStartElection*[SmCommandType, SmStateType](node: RaftNode[SmCommandType, SmStateType]) = discard -proc RaftNodeConsensusProcessRequestVote*(consensus: RaftConsensusModule, msg: RaftMessageRequestVote): RaftMessageRequestVoteResponse = +proc RaftNodeProcessRequestVote*[SmCommandType, SmStateType](node: RaftNode[SmCommandType, SmStateType], msg: RaftMessageRequestVote): RaftMessageRequestVoteResponse = discard -proc RaftNodeConsensusProcessAppendEntries*(consensus: RaftConsensusModule, msg: RaftMessageAppendEntries): RaftMessageAppendEntriesResponse = +proc RaftNodeProcessAppendEntries*[SmCommandType, SmStateType](node: RaftNode[SmCommandType, SmStateType], msg: RaftMessageAppendEntries): RaftMessageAppendEntriesResponse = discard -proc RaftNodeConsensusQuorumMin(consensus: RaftConsensusModule): bool = +proc RaftNodeQuorumMin[SmCommandType, SmStateType](node: RaftNode[SmCommandType, SmStateType]): bool = + discard + +proc RaftNodeReplicateSmCommand*[SmCommandType, SmStateType](node: RaftNode[SmCommandType, SmStateType], cmd: SmCommandType) = + discard + +# Private Timers Create Ops +proc RaftNodeScheduleHeartBeat[SmCommandType, SmStateType](node: RaftNode[SmCommandType, SmStateType]) = + discard + +proc RaftNodeScheduleHeartBeatTimeout[SmCommandType, SmStateType](node: RaftNode[SmCommandType, SmStateType]) = + discard + +proc RaftNodeScheduleElectionTimeOut[SmCommandType, SmStateType](node: RaftNode[SmCommandType, SmStateType]) = + discard + +proc RaftNodeScheduleRequestVoteTimeout[SmCommandType, SmStateType](node: RaftNode[SmCommandType, SmStateType]) = discard \ No newline at end of file diff --git a/raft/raft_api.nim b/raft/raft_api.nim index 13e0200..f178c1a 100644 --- a/raft/raft_api.nim +++ b/raft/raft_api.nim @@ -7,11 +7,12 @@ # This file may not be copied, modified, or distributed except according to # those terms. +import chronicles +import asyncdispatch + import types import protocol import consensus_module -import chronicles -import asyncdispatch export types, protocol, consensus_module @@ -111,17 +112,4 @@ proc RaftNodeLogIndexGet[SmCommandType, SmStateType](node: RaftNode[SmCommandTyp discard proc RaftNodeLogEntryGet[SmCommandType, SmStateType](node: RaftNode[SmCommandType, SmStateType], logIndex: RaftLogIndex): Result[RaftNodeLogEntry[SmCommandType], string] = - discard - -# Private Timers Create Ops -proc RaftNodeScheduleHeartBeat[SmCommandType, SmStateType, TimerDurationType](node: RaftNode[SmCommandType, SmStateType]) = - discard - -proc RaftNodeScheduleHeartBeatTimeout[SmCommandType, SmStateType, TimerDurationType](node: RaftNode[SmCommandType, SmStateType]) = - discard - -proc RaftNodeScheduleElectionTimeOut[SmCommandType, SmStateType, TimerDurationType](node: RaftNode[SmCommandType, SmStateType]) = - discard - -proc RaftNodeScheduleRequestVoteTimeout[SmCommandType, SmStateType, TimerDurationType](node: RaftNode[SmCommandType, SmStateType]) = - discard + discard \ No newline at end of file diff --git a/raft/types.nim b/raft/types.nim index eee6b6d..15afcbb 100644 --- a/raft/types.nim +++ b/raft/types.nim @@ -127,11 +127,6 @@ type # Mtx definition(s) go here raftStateMutex*: Lock - # Modules (Algos) - consensusModule: RaftConsensusModule[SmCommandType, SmStateType] - logCompactionModule: RaftLogCompactionModule[SmCommandType, SmStateType] - membershipChangeModule: RaftMembershipChangeModule[SmCommandType, SmStateType] - # Misc msgSendCallback*: RaftMessageSendCallback persistentStorage: RaftNodePersistentStorage[SmCommandType, SmStateType]