()
| 184 | } |
| 185 | |
| 186 | func (c *core) maintainCluster() (err error) { |
| 187 | |
| 188 | c.annSub, err = c.mbus.SubscribeAnnounce(proxy.AnnouncementSubject(c.prefix), func(o *proxy.Announcement) { |
| 189 | c.cluster.Update(o.Node, o.Application) |
| 190 | }) |
| 191 | if err != nil { |
| 192 | return eris.Wrap(err, "failed to listen to proxy announcements") |
| 193 | } |
| 194 | |
| 195 | // Send an initial ping for proxy announcements |
| 196 | err = c.mbus.PublishPing(proxy.PingSubject(c.prefix)) |
| 197 | if err != nil { |
| 198 | return eris.Wrap(err, "failed to publish ping") |
| 199 | } |
| 200 | return err |
| 201 | } |
| 202 | |
| 203 | // Client provides an ari.Client for an ari-proxy server |
| 204 | type Client struct { |
no test coverage detected