func (r *replicationHandler) Status() (string, *replicationState, error) {
	if r.complete && r.event == nil {
		return "", nil, io.EOF
	}
	r.mu.Lock()
	if r.event == nil {
		r.mu.Unlock()
		// Wait for an event to be ready to read
		r.wg.Wait()
		r.mu.Lock()
	}
	event, state := r.event, r.state
	r.event = nil
	r.mu.Unlock()
	r.wg.Add(1)
	return *event, state, nil
}
// Status returns the last-read status. If the last-read status was already read,
// this blocks until the next event.  If the replication is complete, it will
// return io.EOF immediately.
Status returns the last-read status. If the last-read status was already read,
this blocks until the next event.  If the replication is complete, it will
return io.EOF immediately.
// Status returns the last - read status . If the last - read status was already read // this blocks until the next event . If the replication is complete it will // return io . EOF immediately .
func (r *replicationHandler) Status() (string, *replicationState, error) {
	if r.complete && r.event == nil {
		return "", nil, io.EOF
	}
	r.mu.Lock()
	if r.event == nil {
		r.mu.Unlock()
		r.wg.Wait()
		r.mu.Lock()
	}
	event, state := r.event, r.state
	r.event = nil
	r.mu.Unlock()
	r.wg.Add(1)
	return *event, state, nil
}
func ( r * replicationHandler ) Status ( ) ( string , * replicationState , error ) { if r . complete && r . event == nil { return " " , nil , io . EOF } r . mu . Lock ( ) if r . event == nil { r . mu . Unlock ( ) r . wg . Wait ( ) r . mu . Lock ( ) } event , state := r . event , r . state r . event = nil r . mu . Unlock ( ) r . wg . Add ( 1 ) return * event , state , nil }
Status returns the last-read status.
Status returns the last - read status .
// Wait for an event to be ready to read