Documentation ¶
Index ¶
Constants ¶
View Source
const ( // EventTypeAdd indicates that a node has been added. EventTypeAdd = EventType("add") // EventTypeDel indicates that a node has been removed. EventTypeDel = EventType("del") )
View Source
const ( // NodeTypeMaster indicates that the node is a master. NodeTypeMaster = NodeType("master") // NodeTypeExecutor indicates that the node is an executor. NodeTypeExecutor = NodeType("executor") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent interface { Run(ctx context.Context) error Subscribe(ctx context.Context) (Snapshot, *notifier.Receiver[Event], error) }
Agent registers receives membership changes of all nodes.
func NewAgent ¶
func NewAgent( discoveryClient client.DiscoveryClient, autoSyncInterval time.Duration, ) Agent
NewAgent creates a new Agent that receives membership changes from the discovery service. autoSyncInterval is the interval to update membership with the latest information and notify subscribers.
Click to show internal directories.
Click to hide internal directories.