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.
| 24 | // status changed on this node, an event will be triggered. See example for how |
| 25 | // to listen this event. |
| 26 | type 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. |
| 33 | func NewElection(dispatcher contract.Dispatcher, driver Driver) *Election { |
nothing calls this directly
no outgoing calls
no test coverage detected