runAnnouncer runs the periodic discovery announcer
(ctx context.Context)
| 246 | |
| 247 | // runAnnouncer runs the periodic discovery announcer |
| 248 | func (s *Server) runAnnouncer(ctx context.Context) { |
| 249 | ticker := time.NewTicker(proxy.AnnouncementInterval) |
| 250 | defer ticker.Stop() |
| 251 | |
| 252 | for { |
| 253 | select { |
| 254 | case <-ctx.Done(): |
| 255 | return |
| 256 | case <-ticker.C: |
| 257 | s.announce() |
| 258 | } |
| 259 | } |
| 260 | } |
| 261 | |
| 262 | // announce publishes the presence of this server to the cluster |
| 263 | func (s *Server) announce() { |