jldb/mdb/walfollower.go

36 lines
480 B
Go
Raw Permalink Normal View History

2023-10-13 09:43:27 +00:00
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)
}
}
*/