Documentation ¶
Index ¶
Constants ¶
View Source
const ( // DefaultRoundTimeout timeout DefaultRoundTimeout = 6000 // DefaultRoundTimeoutInterval interval DefaultRoundTimeoutInterval = 500 )
Variables ¶
Functions ¶
func GetEventTimeout ¶
func GetEventTimeout(evtType TimerEventType, roundIndex int32) time.Duration
GetEventTimeout returns the time duration per event type and consensus roundIndex
Types ¶
type TimerEvent ¶
type TimerEvent struct { View uint64 // view in the consensus Duration time.Duration // timeout Type maxbftpb.ConsStateType // Monitored events }
TimerEvent defines a timer event
func (*TimerEvent) String ¶
func (t *TimerEvent) String() string
type TimerEventType ¶
type TimerEventType int
TimerEventType defines the consensus event type
const ( PROPOSAL_BLOCK_TIMEOUT TimerEventType = iota VOTE_BLOCK_TIMEOUT ROUND_TIMEOUT )
Events: proposal block, vote block, get transaction, empty block, commit block, heartbeat
type TimerService ¶
type TimerService struct {
// contains filtered or unexported fields
}
TimerService provides timer service
func NewTimerService ¶
func NewTimerService(log protocol.Logger) *TimerService
NewTimerService initializes an instance of timer service
func (*TimerService) AddEvent ¶
func (ts *TimerService) AddEvent(event *TimerEvent)
AddEvent adds an timer event to timer channel
func (*TimerService) GetFiredCh ¶
func (ts *TimerService) GetFiredCh() <-chan *TimerEvent
GetFiredCh returns a channel to receive events
func (*TimerService) GetMonitorEvent ¶
func (ts *TimerService) GetMonitorEvent() *TimerEvent
GetMonitorEvent return pacemakerEvent
Click to show internal directories.
Click to hide internal directories.