MCPcopy Create free account
hub / github.com/DoNewsCode/core / Election

Struct Election

leader/election.go:26–30  ·  view source on GitHub ↗

Election is a struct that controls the leader election. Whenever the leader status changed on this node, an event will be triggered. See example for how to listen this event.

Source from the content-addressed store, hash-verified

24// status changed on this node, an event will be triggered. See example for how
25// to listen this event.
26type Election struct {
27 dispatcher contract.Dispatcher
28 status *Status
29 driver Driver
30}
31
32// NewElection returns a pointer to the newly constructed Election instance.
33func NewElection(dispatcher contract.Dispatcher, driver Driver) *Election {

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected