clientv3/watch.go
func (w *watcher) RequestProgress(ctx context.Context) (err error) {
	ctxKey := streamKeyFromCtx(ctx)

	w.mu.Lock()
	if w.streams == nil {
		return fmt.Errorf("no stream found for context")
	}
	wgs := w.streams[ctxKey]
	if wgs == nil {
		wgs = w.newWatcherGrpcStream(ctx)
		w.streams[ctxKey] = wgs
	}
	donec := wgs.donec
	reqc := wgs.reqc
	w.mu.Unlock()

	pr := &progressRequest{}

	select {
	case reqc <- pr:
		return nil
	case <-ctx.Done():
		if err == nil {
			return ctx.Err()
		}
		return err
	case <-donec:
		if wgs.closeErr != nil {
			return wgs.closeErr
		}
		// retry; may have dropped stream from no ctxs
		return w.RequestProgress(ctx)
	}
}
func (w *watcher) RequestProgress(ctx context.Context) (err error) {
	ctxKey := streamKeyFromCtx(ctx)

	w.mu.Lock()
	if w.streams == nil {
		return fmt.Errorf("no stream found for context")
	}
	wgs := w.streams[ctxKey]
	if wgs == nil {
		wgs = w.newWatcherGrpcStream(ctx)
		w.streams[ctxKey] = wgs
	}
	donec := wgs.donec
	reqc := wgs.reqc
	w.mu.Unlock()

	pr := &progressRequest{}

	select {
	case reqc <- pr:
		return nil
	case <-ctx.Done():
		if err == nil {
			return ctx.Err()
		}
		return err
	case <-donec:
		if wgs.closeErr != nil {
			return wgs.closeErr
		}
		// retry; may have dropped stream from no ctxs
		return w.RequestProgress(ctx)
	}
}
func ( w * watcher ) RequestProgress ( ctx context . Context ) ( err error ) { ctxKey := streamKeyFromCtx ( ctx ) w . mu . Lock ( ) if w . streams == nil { return fmt . Errorf ( " " ) } wgs := w . streams [ ctxKey ] if wgs == nil { wgs = w . newWatcherGrpcStream ( ctx ) w . streams [ ctxKey ] = wgs } donec := wgs . donec reqc := wgs . reqc w . mu . Unlock ( ) pr := & progressRequest { } select { case reqc <- pr : return nil case <- ctx . Done ( ) : if err == nil { return ctx . Err ( ) } return err case <- donec : if wgs . closeErr != nil { return wgs . closeErr } // retry; may have dropped stream from no ctxs return w . RequestProgress ( ctx ) } }
// RequestProgress requests a progress notify response be sent in all watch channels.
RequestProgress requests a progress notify response be sent in all watch channels .