dispatcher

package
v1.14.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2023 License: Apache-2.0 Imports: 22 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNodeID

func GetNodeID(msg *beehivemodel.Message) (string, error)

GetNodeID from "beehive/pkg/core/model".Message.Router.Resource

Types

type MessageDispatcher

type MessageDispatcher interface {
	// DispatchDownstream continuously reads the messages from cloudHub module,
	// and according to the content of the message, the message is dispatched
	// to the message queue of each edge node.
	DispatchDownstream()

	// DispatchUpstream dispatch messages sent from edge nodes to the cloud,
	// such as node status messages, pod status messages, etc.
	DispatchUpstream(message *beehivemodel.Message, info *model.HubInfo)

	// AddNodeMessagePool add the given node message pool to the dispatcher.
	AddNodeMessagePool(nodeID string, pool *common.NodeMessagePool)

	// DeleteNodeMessagePool deletes the given node message pool from the dispatcher.
	DeleteNodeMessagePool(nodeID string, pool *common.NodeMessagePool)

	// GetNodeMessagePool provides the nodeMessagePool that matches node ID
	GetNodeMessagePool(nodeID string) *common.NodeMessagePool

	// Publish sends the given message to module according to the message source
	Publish(msg *beehivemodel.Message) error
}

MessageDispatcher is responsible for the dispatch of upstream messages (edge ​​to cloud) and downstream messages (cloud to edge)

func NewMessageDispatcher

func NewMessageDispatcher(
	sessionManager *session.Manager,
	objectSyncLister synclisters.ObjectSyncLister,
	clusterObjectSyncLister synclisters.ClusterObjectSyncLister,
	reliableClient reliableclient.Interface) MessageDispatcher

NewMessageDispatcher initializes a new MessageDispatcher

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL