mirror of
https://github.com/etcd-io/etcd.git
synced 2024-09-27 06:25:44 +00:00
refactor(main): remove Etcd.StopNotify() method
This commit is contained in:
parent
c5632b039a
commit
dfbabc5a77
@ -46,7 +46,6 @@ type Etcd struct {
|
|||||||
listener net.Listener // Listener for Server
|
listener net.Listener // Listener for Server
|
||||||
peerListener net.Listener // Listener for PeerServer
|
peerListener net.Listener // Listener for PeerServer
|
||||||
readyC chan bool // To signal when server is ready to accept connections
|
readyC chan bool // To signal when server is ready to accept connections
|
||||||
stopC chan bool // To signal when etcd is stopped with Stop() method
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// New returns a new Etcd instance.
|
// New returns a new Etcd instance.
|
||||||
@ -57,7 +56,6 @@ func New(c *config.Config) *Etcd {
|
|||||||
return &Etcd{
|
return &Etcd{
|
||||||
Config: c,
|
Config: c,
|
||||||
readyC: make(chan bool),
|
readyC: make(chan bool),
|
||||||
stopC: make(chan bool),
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -220,8 +218,6 @@ func (e *Etcd) Run() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
<-peerServerClosed
|
<-peerServerClosed
|
||||||
close(e.stopC) // etcd instance is stopped, notify waiters.
|
|
||||||
|
|
||||||
log.Infof("etcd instance is stopped [name %s]", e.Config.Name)
|
log.Infof("etcd instance is stopped [name %s]", e.Config.Name)
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -231,10 +227,6 @@ func (e *Etcd) Stop() {
|
|||||||
e.listener.Close()
|
e.listener.Close()
|
||||||
}
|
}
|
||||||
|
|
||||||
func (e *Etcd) StopNotify() chan bool {
|
|
||||||
return e.stopC
|
|
||||||
}
|
|
||||||
|
|
||||||
func (e *Etcd) ReadyNotify() chan bool {
|
func (e *Etcd) ReadyNotify() chan bool {
|
||||||
return e.readyC
|
return e.readyC
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user