diff --git a/agent.go b/agent.go index 489df4e..1d251f6 100644 --- a/agent.go +++ b/agent.go @@ -5,6 +5,7 @@ import ( "sync" "time" + "github.com/gogo/protobuf/types" "github.com/hashicorp/memberlist" ) @@ -66,6 +67,11 @@ func (a *Agent) SyncInterval() time.Duration { return a.memberConfig.PushPullInterval } +// Update updates the agent payload +func (a *Agent) Update(payload *types.Any) { + a.state.Self.Payload = payload +} + func newSubscribers() *subscribers { return &subscribers{ subs: make(map[chan *NodeEvent]struct{}),