Help us shape the future of Go! Take the 2026 Go Developer Survey

handler

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2025 License: BSD-3-Clause Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Ctx              *core.Context
	Validators       validators.Set
	MsgFromVMChan    <-chan message.InboundMessage
	ConsensusParams  Parameters
	Gossiper         Gossiper
	ExternalGossiper ExternalGossiper
	Router           router.Router
}

Config configures the consensus message handler

type ExternalGossiper

type ExternalGossiper interface {
	Gossiper
	// GossipExternal sends an external gossip message
	GossipExternal(context.Context) error
}

ExternalGossiper handles external gossip operations

type Gossiper

type Gossiper interface {
	// Gossip sends a gossip message
	Gossip(context.Context) error
}

Gossiper handles gossip operations

type Handler

type Handler interface {
	// Context returns the handler's context
	Context() *core.Context

	// SetEngine sets the consensus engine
	SetEngine(engine core.Engine)

	// Push pushes a message to be handled
	Push(context.Context, Message) error

	// Len returns the number of pending messages
	Len() int

	// Stop stops the handler
	Stop(context.Context)
}

Handler handles incoming consensus messages

type Message

type Message struct {
	// InboundMessage is the message received from the network
	message.InboundMessage
	// Engine is the consensus engine to handle the message
	Engine core.Engine
	// Received is when the message was received
	Received time.Time
}

Message represents a consensus message

type Parameters

type Parameters struct {
	K                     int
	AlphaPreference       int
	AlphaConfidence       int
	Beta                  int
	ConcurrentRepolls     int
	OptimalProcessing     int
	MaxOutstandingItems   int
	MaxItemProcessingTime time.Duration
}

Parameters configures consensus handling behavior

Jump to

Keyboard shortcuts

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