Commit 6fd29c73 authored by vicotor's avatar vicotor

add register

parent 9c004070
......@@ -81,18 +81,25 @@ func NewNode() *Node {
brokers := strings.Split(node.conf.Kafka.Brokers, ";")
node.kafkaProducer, _ = utils.NewKafkaProducer(brokers)
node.status = "before running"
node.register()
return node
}
func (n *Node) Start() error {
n.status = "running"
if n.reg != nil {
n.reg.Start()
}
return n.startAllTask()
}
func (n *Node) Stop() {
close(n.quit)
n.wg.Wait()
if n.reg != nil {
n.reg.Stop()
}
n.status = "stopped"
}
......@@ -111,7 +118,6 @@ func (n *Node) register() {
DbIndex: n.conf.Redis.DbIndex,
}, n)
n.reg = reg
reg.Start()
}
func (n *Node) Loop(idx int) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment