head

package
v0.7.6 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultRollCallTimeout         = 5 * time.Second
	DefaultExecutionTimeout        = 20 * time.Second
	DefaultClusterFormationTimeout = 10 * time.Second
	DefaultConsensusAlgorithm      = consensus.Raft
)

Variables

View Source
var Counters = []prometheus.CounterDefinition{
	{
		Name: rollCallsPublishedMetric,
		Help: "Number of roll calls this node issued.",
	},
	{
		Name: executionsMetric,
		Help: "Number of function executions.",
	},
}
View Source
var DefaultConfig = Config{
	RollCallTimeout:         DefaultRollCallTimeout,
	ExecutionTimeout:        DefaultExecutionTimeout,
	ClusterFormationTimeout: DefaultClusterFormationTimeout,
	DefaultConsensus:        DefaultConsensusAlgorithm,
}

DefaultConfig represents the default settings for the node.

Functions

This section is empty.

Types

type Config

type Config struct {
	RollCallTimeout         time.Duration  // How long do we wait for roll call responses.
	ExecutionTimeout        time.Duration  // How long does the head node wait for worker nodes to send their execution results.
	ClusterFormationTimeout time.Duration  // How long do we wait for the nodes to form a cluster for an execution.
	DefaultConsensus        consensus.Type // Default consensus algorithm to use.
}

Config represents the Node configuration.

func (Config) Valid

func (c Config) Valid() error

type HeadNode

type HeadNode struct {
	node.Core
	// contains filtered or unexported fields
}

func New

func New(core node.Core, options ...Option) (*HeadNode, error)

func (*HeadNode) ExecuteFunction

func (h *HeadNode) ExecuteFunction(ctx context.Context, req execute.Request, subgroup string) (codes.Code, string, execute.ResultMap, execute.Cluster, error)

ExecuteFunction can be used to start function execution. At the moment this is used by the API server to start execution on the head node.

func (*HeadNode) ExecutionResult

func (h *HeadNode) ExecutionResult(id string) (execute.ResultMap, bool)

ExecutionResult fetches the execution result from the node cache.

func (*HeadNode) PublishFunctionInstall

func (h *HeadNode) PublishFunctionInstall(ctx context.Context, uri string, cid string, subgroup string) error

PublishFunctionInstall publishes a function install message.

func (*HeadNode) Run

func (h *HeadNode) Run(ctx context.Context) error

type Option

type Option func(*Config)

Option can be used to set Node configuration options.

Jump to

Keyboard shortcuts

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