poll

package
v1.2.4-arm-fix Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: BSD-3-Clause Imports: 7 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Factory

type Factory interface {
	New(vdrs ids.ShortBag) Poll
}

Factory creates a new Poll

func NewEarlyTermNoTraversalFactory

func NewEarlyTermNoTraversalFactory(alpha int) Factory

NewEarlyTermNoTraversalFactory returns a factory that returns polls with early termination, without doing DAG traversals

func NewNoEarlyTermFactory

func NewNoEarlyTermFactory() Factory

NewNoEarlyTermFactory returns a factory that returns polls with no early termination

type Poll

type Poll interface {
	fmt.Stringer
	PrefixedString(string) string

	Vote(vdr ids.ShortID, vote ids.ID)
	Drop(vdr ids.ShortID)
	Finished() bool
	Result() ids.Bag
}

Poll is an outstanding poll

type Set

type Set interface {
	fmt.Stringer

	Add(requestID uint32, vdrs ids.ShortBag) bool
	Vote(requestID uint32, vdr ids.ShortID, vote ids.ID) (ids.Bag, bool)
	Drop(requestID uint32, vdr ids.ShortID) (ids.Bag, bool)
	Len() int
}

Set is a collection of polls

func NewSet

func NewSet(
	factory Factory,
	log logging.Logger,
	namespace string,
	registerer prometheus.Registerer,
) Set

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