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

poll

package
v1.16.15 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BlockTraversal

type BlockTraversal interface {
	GetParent(id ids.ID) (ids.ID, bool)
}

type Factory

type Factory interface {
	New(vdrs bag.Bag[ids.NodeID]) Poll
}

Factory creates a new Poll

func NewEarlyTermFactory

func NewEarlyTermFactory(
	alphaPreference int,
	alphaConfidence int,
	reg prometheus.Registerer,
	bt BlockTraversal,
) (Factory, error)

NewEarlyTermFactory returns a factory that returns polls with early termination.

type Poll

type Poll interface {
	formatting.PrefixedStringer

	Vote(vdr ids.NodeID, vote ids.ID)
	Drop(vdr ids.NodeID)
	Finished() bool
	Result() bag.Bag[ids.ID]
}

Poll is an outstanding poll

type Set

type Set interface {
	fmt.Stringer

	Add(requestID uint32, vdrs bag.Bag[ids.NodeID]) bool
	Vote(requestID uint32, vdr ids.NodeID, vote ids.ID) []bag.Bag[ids.ID]
	Drop(requestID uint32, vdr ids.NodeID) []bag.Bag[ids.ID]
	Len() int
}

Set is a collection of polls

func NewSet

func NewSet(
	factory Factory,
	log log.Logger,
	reg prometheus.Registerer,
) (Set, error)

NewSet returns a new empty set of polls

Jump to

Keyboard shortcuts

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