(ctx context.Context)
| 66 | } |
| 67 | |
| 68 | func (c *Controller) Start(ctx context.Context) error { |
| 69 | if !c.state.CompareAndSwap(stateInit, stateRunning) { |
| 70 | return nil |
| 71 | } |
| 72 | |
| 73 | c.wg.Add(1) |
| 74 | go c.syncLoop(ctx) |
| 75 | c.wg.Add(1) |
| 76 | go c.leaderEventLoop() |
| 77 | return nil |
| 78 | } |
| 79 | |
| 80 | func (c *Controller) WaitForReady() { |
| 81 | <-c.readyCh |