Documentation ¶
Index ¶
Constants ¶
View Source
const (
MaxLiveChecksPerRun = 20 // Max Live Checks per run
)
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LiveCheckTask ¶
type LiveCheckTask struct { NodeTable *routingtable.RoutingTable // The routing table CheckInterval int // the check interval given in time.Seconds MaxRetriesForEviction int // The maximum number of retries for evicting a peer from bucket. IsTaskAlive bool // is the task alive? ProtoMessenger *network.ProtocolMessenger // The protocol Messenger }
LiveCheckTask is a background task that executes at least once in the specifies interval. It checks for the "Liveliness" of the peers in the routingtable.RoutingTable, Once the peer is un responsive for a number of tries, then it evicts the peer from the routingtable.RoutingTable Each ping is restricted to 10 seconds. This can be added as a configurable param later if needed.
func NewLiveCheckTask ¶
func NewLiveCheckTask(routingTable *routingtable.RoutingTable, checkInterval int, retiresForEviction int, pMes *network.ProtocolMessenger) *LiveCheckTask
func (*LiveCheckTask) Stop ¶
func (lt *LiveCheckTask) Stop()
Click to show internal directories.
Click to hide internal directories.