add HasLeader function

This commit is contained in:
Xiang Li
2014-06-19 14:39:17 -07:00
committed by Yicheng Qin
parent dd94d5d4e8
commit 584186c7ff

View File

@@ -47,6 +47,8 @@ func Dictate(n *Node) *Node {
func (n *Node) Id() int { return n.sm.id }
func (n *Node) HasLeader() bool { return n.sm.lead != none }
// Propose asynchronously proposes data be applied to the underlying state machine.
func (n *Node) Propose(data []byte) { n.propose(normal, data) }