// WaitEvents waits on a key until it observes the given events and returns the final one.
WaitEvents waits on a key until it observes the given events and returns the final one.
// WaitEvents waits on a key until it observes the given events and returns the final one .
func WaitEvents(c *clientv3.Client, key string, rev int64, evs []mvccpb.Event_EventType) (*clientv3.Event, error) {
	ctx, cancel := context.WithCancel(context.Background())
	defer cancel()
	wc := c.Watch(ctx, key, clientv3.WithRev(rev))
	if wc == nil {
		return nil, ErrNoWatcher
	}
	return waitEvents(wc, evs), nil
}
func WaitEvents ( c * clientv3 . Client , key string , rev int64 , evs [ ] mvccpb . Event_EventType ) ( * clientv3 . Event , error ) { ctx , cancel := context . WithCancel ( context . Background ( ) ) defer cancel ( ) wc := c . Watch ( ctx , key , clientv3 . WithRev ( rev ) ) if wc == nil { return nil , ErrNoWatcher } return waitEvents ( wc , evs ) , nil }
WaitEvents waits on a key until it observes the given events and returns the final one.
WaitEvents waits on a key until it observes the given events and returns the final one .