stopPushDispatch signals the loop to exit. Safe when it never started.
()
| 298 | |
| 299 | // stopPushDispatch signals the loop to exit. Safe when it never started. |
| 300 | func (s *Server) stopPushDispatch() { |
| 301 | d := &s.pushDispatch |
| 302 | d.mu.Lock() |
| 303 | defer d.mu.Unlock() |
| 304 | if !d.running { |
| 305 | return |
| 306 | } |
| 307 | close(d.stop) |
| 308 | d.running = false |
| 309 | } |
| 310 | |
| 311 | // pushUnit is the rows of one (user, item) group after gating, which become |
| 312 | // one push per live device. nid and kind are the newest row's. |