start requests a LIST operation from the kvstore and starts watching the prefix in a go subroutine.
()
| 258 | // start requests a LIST operation from the kvstore and starts watching the |
| 259 | // prefix in a go subroutine. |
| 260 | func (c *cache) start() waitChan { |
| 261 | c.listDone = make(waitChan) |
| 262 | |
| 263 | c.mutex.Lock() |
| 264 | |
| 265 | // start with a fresh nextCache |
| 266 | c.nextCache = idMap{} |
| 267 | c.nextKeyCache = keyMap{} |
| 268 | c.mutex.Unlock() |
| 269 | |
| 270 | c.stopWatchWg.Go(func() { |
| 271 | c.allocator.backend.ListAndWatch(c.ctx, c) |
| 272 | }) |
| 273 | |
| 274 | return c.listDone |
| 275 | } |
| 276 | |
| 277 | func (c *cache) stop() { |
| 278 | c.cancel() |
no test coverage detected