etcd: Rename loop to be more consistent in messages
Small nitpick fixups
This commit is contained in:
16
etcd.go
16
etcd.go
@@ -332,8 +332,8 @@ func (obj *EmbdEtcd) Startup() error {
|
|||||||
}
|
}
|
||||||
}()
|
}()
|
||||||
|
|
||||||
go obj.CallbackLoop() // start callback loop
|
go obj.CbLoop() // start callback loop
|
||||||
go obj.Loop() // start main loop
|
go obj.Loop() // start main loop
|
||||||
|
|
||||||
// TODO: implement native etcd watcher method on member API changes
|
// TODO: implement native etcd watcher method on member API changes
|
||||||
path := fmt.Sprintf("/%s/nominated/", NS)
|
path := fmt.Sprintf("/%s/nominated/", NS)
|
||||||
@@ -675,8 +675,8 @@ func (obj *EmbdEtcd) CtxError(ctx context.Context, err error) (context.Context,
|
|||||||
return ctx, obj.ctxErr
|
return ctx, obj.ctxErr
|
||||||
}
|
}
|
||||||
|
|
||||||
// CallbackLoop is the loop where callback execution is serialized
|
// CbLoop is the loop where callback execution is serialized
|
||||||
func (obj *EmbdEtcd) CallbackLoop() {
|
func (obj *EmbdEtcd) CbLoop() {
|
||||||
cuuid := obj.converger.Register()
|
cuuid := obj.converger.Register()
|
||||||
defer cuuid.Unregister()
|
defer cuuid.Unregister()
|
||||||
if e := obj.Connect(false); e != nil {
|
if e := obj.Connect(false); e != nil {
|
||||||
@@ -689,7 +689,7 @@ func (obj *EmbdEtcd) CallbackLoop() {
|
|||||||
case re := <-obj.wevents:
|
case re := <-obj.wevents:
|
||||||
cuuid.SetConverged(false) // activity!
|
cuuid.SetConverged(false) // activity!
|
||||||
if TRACE {
|
if TRACE {
|
||||||
log.Printf("Trace: Etcd: Loop: Event: StartLoop")
|
log.Printf("Trace: Etcd: CbLoop: Event: StartLoop")
|
||||||
}
|
}
|
||||||
for {
|
for {
|
||||||
if obj.exiting { // the exit signal has been sent!
|
if obj.exiting { // the exit signal has been sent!
|
||||||
@@ -697,11 +697,11 @@ func (obj *EmbdEtcd) CallbackLoop() {
|
|||||||
break
|
break
|
||||||
}
|
}
|
||||||
if TRACE {
|
if TRACE {
|
||||||
log.Printf("Trace: Etcd: Loop: rawCallback()")
|
log.Printf("Trace: Etcd: CbLoop: rawCallback()")
|
||||||
}
|
}
|
||||||
err := rawCallback(ctx, re)
|
err := rawCallback(ctx, re)
|
||||||
if TRACE {
|
if TRACE {
|
||||||
log.Printf("Trace: Etcd: Loop: rawCallback(): %v", err)
|
log.Printf("Trace: Etcd: CbLoop: rawCallback(): %v", err)
|
||||||
}
|
}
|
||||||
if err == nil {
|
if err == nil {
|
||||||
//re.resp.ACK() // success
|
//re.resp.ACK() // success
|
||||||
@@ -713,7 +713,7 @@ func (obj *EmbdEtcd) CallbackLoop() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if TRACE {
|
if TRACE {
|
||||||
log.Printf("Trace: Etcd: Loop: Event: FinishLoop")
|
log.Printf("Trace: Etcd: CbLoop: Event: FinishLoop")
|
||||||
}
|
}
|
||||||
|
|
||||||
// converged timeout
|
// converged timeout
|
||||||
|
|||||||
Reference in New Issue
Block a user