roundtimer

package
v1.0.1-rc.0 Latest Latest
Warning

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

Go to latest
Published: Oct 27, 2023 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RoundTimeout

func RoundTimeout(r specqbft.Round) time.Duration

RoundTimeout returns the number of seconds until next timeout for a give round. if the round is smaller than 8 -> 2s; otherwise -> 2m see SIP https://github.com/bloxapp/SIPs/pull/22

Types

type RoundTimeoutFunc

type RoundTimeoutFunc func(specqbft.Round) time.Duration

type RoundTimer

type RoundTimer struct {
	// contains filtered or unexported fields
}

RoundTimer helps to manage current instance rounds.

func New

func New(pctx context.Context, done func()) *RoundTimer

New creates a new instance of RoundTimer.

func (*RoundTimer) OnTimeout

func (t *RoundTimer) OnTimeout(done func())

OnTimeout sets a function called on timeout.

func (*RoundTimer) Round

func (t *RoundTimer) Round() specqbft.Round

Round returns a round.

func (*RoundTimer) TimeoutForRound

func (t *RoundTimer) TimeoutForRound(round specqbft.Round)

TimeoutForRound times out for a given round.

Jump to

Keyboard shortcuts

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