Documentation
¶
Overview ¶
Package state defines the states of the node state machine.
Index ¶
Constants ¶
View Source
const WGLIMIT = 20
WGLIMIT is the maximum number of goroutines that can be launched through state.GoFunc
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager wraps a State with get and set methods. It is also used to limit the number of goroutines launched by the node, and to wait for all of them to complete.
func (*Manager) GoFunc ¶
func (b *Manager) GoFunc(f func())
GoFunc launches a goroutine for a given function, if there are currently less than WGLIMIT running. It increments the waitgroup.
func (*Manager) WaitRoutines ¶
func (b *Manager) WaitRoutines()
WaitRoutines waits for all the goroutines in the waitgroup.
type State ¶
type State uint32
State captures the state of a Babble node: Babbling, CatchingUp, Joining, Leaving, Suspended, or Shutdown
const ( // Babbling is the state in which a node gossips regularly with other nodes // as part of the hashgraph consensus algorithm, and responds to other // requests. Babbling State = iota // CatchingUp is the state in which a node attempts to fast-forward to a // future point in the hashgraph as part of the FastSync protocol. CatchingUp // Joining is the state in which a node attempts to join a Babble group by // submitting a join request. Joining // Leaving is the state in which a node attempts to politely leave a Babble // group by submitting a leave request. Leaving // Shutdown is the state in which a node stops responding to external events // and closes its transport. Shutdown // Suspended is the state in which a node passively participates in the // gossip protocol but does not process any new events or transactions. Suspended )
Click to show internal directories.
Click to hide internal directories.