36 lines
480 B
Go
36 lines
480 B
Go
package mdb
|
|
|
|
/*
|
|
type walFollower struct {
|
|
Stop chan struct{}
|
|
Done *sync.WaitGroup
|
|
W *cswal.Writer
|
|
Client *Client
|
|
}
|
|
|
|
func (f *walFollower) Run() {
|
|
go func() {
|
|
<-f.Stop
|
|
f.Client.Close()
|
|
}()
|
|
|
|
defer f.Done.Done()
|
|
|
|
for {
|
|
f.runOnce()
|
|
select {
|
|
case <-f.Stop:
|
|
return
|
|
default:
|
|
time.Sleep(time.Second)
|
|
}
|
|
}
|
|
}
|
|
|
|
func (f *walFollower) runOnce() {
|
|
if err := f.Client.StreamWAL(f.W); err != nil {
|
|
log.Printf("[WAL-FOLLOWER] Recv failed: %s", err)
|
|
}
|
|
}
|
|
*/
|