Refactor some module imports/exports
This commit is contained in:
parent
634094f766
commit
a69f528bc1
|
@ -11,6 +11,8 @@ import basic_timers
|
|||
import basic_state_machine
|
||||
import ../raft/raft_api
|
||||
|
||||
export raft_api
|
||||
|
||||
type
|
||||
BasicRaftNode* = RaftNode[SmCommand, SmState]
|
||||
|
||||
|
|
|
@ -7,9 +7,10 @@
|
|||
# This file may not be copied, modified, or distributed except according to
|
||||
# those terms.
|
||||
|
||||
import ../raft/types
|
||||
import std/tables
|
||||
export tables
|
||||
import ../raft/raft_api
|
||||
|
||||
export tables, raft_api
|
||||
|
||||
type
|
||||
SmState* = Table[string, string]
|
||||
|
|
|
@ -8,20 +8,15 @@
|
|||
# those terms.
|
||||
|
||||
import std/asyncdispatch
|
||||
import std/locks
|
||||
import ../raft/types
|
||||
import uuids
|
||||
import ../raft/raft_api
|
||||
|
||||
export asyncdispatch
|
||||
export asyncdispatch, raft_api
|
||||
|
||||
var
|
||||
pollThr: Thread[void]
|
||||
runningMtx: Lock
|
||||
running: bool
|
||||
|
||||
timersChan: seq[RaftTimer]
|
||||
timersChanMtx: Lock
|
||||
|
||||
proc RaftTimerCreateCustomImpl*(timerInterval: int, oneshot: bool, timerCallback: RaftTimerCallback): RaftTimer {.nimcall, gcsafe.} =
|
||||
var
|
||||
timer = RaftTimer(mtx: Lock(), canceled: false, expired: false, timeout: timerInterval, oneshot: oneshot)
|
||||
|
|
|
@ -9,7 +9,6 @@
|
|||
|
||||
import unittest2
|
||||
import basic_cluster
|
||||
import ../raft/types
|
||||
|
||||
proc basicClusterMain*() =
|
||||
var
|
||||
|
|
|
@ -8,8 +8,6 @@
|
|||
# those terms.
|
||||
|
||||
import unittest2
|
||||
import ../raft/types
|
||||
import std/locks
|
||||
import basic_timers
|
||||
import random
|
||||
|
||||
|
|
Loading…
Reference in New Issue