Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type RoundTimer ¶
type RoundTimer struct {
// contains filtered or unexported fields
}
RoundTimer helps to manage current instance rounds. it should be killed (Kill()) once the instance finished and recreated for each new IBFT instance, in that case 'false' is returned in result channel. if round has timed-out, the timer returns 'true' in the result channel. upon new round, Reset() should be called to reset the timer with the new timeout.
func New ¶
func New(pctx context.Context, logger *zap.Logger) *RoundTimer
New creates a new instance of RoundTimer
func (*RoundTimer) Reset ¶
func (t *RoundTimer) Reset(d time.Duration)
Reset will reset the underlying timer
func (*RoundTimer) ResultChan ¶
func (t *RoundTimer) ResultChan() <-chan bool
ResultChan returns the result chan true if the timer lapsed or false if it was stopped
func (*RoundTimer) Stopped ¶
func (t *RoundTimer) Stopped() bool
Stopped returns whether the timer has stopped
Click to show internal directories.
Click to hide internal directories.