Commit 9a10e95f authored by Hongchao Deng's avatar Hongchao Deng

docs: Reflector ListAndWatch

parent 9d23d750
...@@ -222,7 +222,9 @@ func (r *Reflector) canForceResyncNow() bool { ...@@ -222,7 +222,9 @@ func (r *Reflector) canForceResyncNow() bool {
return r.now().Add(forceResyncThreshold).After(r.nextResync) return r.now().Add(forceResyncThreshold).After(r.nextResync)
} }
// Returns error if ListAndWatch didn't even tried to initialize watch. // ListAndWatch first lists all items and get the resource version at the moment of call,
// and then use the resource version to watch.
// It returns error if ListAndWatch didn't even try to initialize watch.
func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error { func (r *Reflector) ListAndWatch(stopCh <-chan struct{}) error {
var resourceVersion string var resourceVersion string
resyncCh, cleanup := r.resyncChan() resyncCh, cleanup := r.resyncChan()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment