Documentation
¶
Index ¶
Constants ¶
const ( // DefaultTimeout is the timeout in seconds set by default DefaultTimeout = 20 * time.Second // DefaultTimeoutScaling is the timeout scaling factor set by default DefaultTimeoutScaling = 0.5 )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LinearTimer ¶
type LinearTimer struct {
// contains filtered or unexported fields
}
LinearTimer defines a timer that implements a timing out functionality. The timeouts for different contexts (Propose, Prevote and Precommit) are provided as callback functions that handle the corresponding timeouts. The timeout scales linearly with the consensus round
func (*LinearTimer) TimeoutPrecommit ¶
func (t *LinearTimer) TimeoutPrecommit(height process.Height, round process.Round)
TimeoutPrecommit schedules a precommit timeout with a timeout period appropriately calculated for the consensus height and round
func (*LinearTimer) TimeoutPrevote ¶
func (t *LinearTimer) TimeoutPrevote(height process.Height, round process.Round)
TimeoutPrevote schedules a prevote timeout with a timeout period appropriately calculated for the consensus height and round
func (*LinearTimer) TimeoutPropose ¶
func (t *LinearTimer) TimeoutPropose(height process.Height, round process.Round)
TimeoutPropose schedules a propose timeout with a timeout period appropriately calculated for the consensus height and round
type Options ¶
Options represent the options for a Linear Timer
func DefaultOptions ¶
func DefaultOptions() Options
DefaultOptions returns the default options for a Linear Timer
func (Options) WithLogger ¶ added in v0.4.1
WithLogger updates the logger used in the Linear Timer
func (Options) WithTimeout ¶
WithTimeout updates the timeout of the Linear Timer
func (Options) WithTimeoutScaling ¶
WithTimeoutScaling updates the timeout scaling factor of the Linear Timer