Documentation ¶
Index ¶
- type Manager
- func (m *Manager) Dispatch()
- func (m *Manager) Initialize(timeoutConfig *timer.AdaptiveTimeoutConfig, benchlistMgr benchlist.Manager, ...) error
- func (m *Manager) IsBenched(validatorID ids.ShortID, chainID ids.ID) bool
- func (m *Manager) RegisterChain(ctx *snow.Context, namespace string) error
- func (m *Manager) RegisterRequest(validatorID ids.ShortID, chainID ids.ID, op message.Op, uniqueRequestID ids.ID, ...) (time.Time, bool)
- func (m *Manager) RegisterRequestToUnreachableValidator()
- func (m *Manager) RegisterResponse(validatorID ids.ShortID, chainID ids.ID, uniqueRequestID ids.ID, op message.Op, ...)
- func (m *Manager) RemoveRequest(uniqueRequestID ids.ID)
- func (m *Manager) TimeoutDuration() time.Duration
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager registers and fires timeouts for the snow API.
func (*Manager) Initialize ¶
func (m *Manager) Initialize( timeoutConfig *timer.AdaptiveTimeoutConfig, benchlistMgr benchlist.Manager, metricsNamespace string, metricsRegister prometheus.Registerer, ) error
Initialize this timeout manager.
func (*Manager) IsBenched ¶
IsBenched returns true if messages to [validatorID] regarding [chainID] should not be sent over the network and should immediately fail.
func (*Manager) RegisterChain ¶
func (*Manager) RegisterRequest ¶
func (m *Manager) RegisterRequest( validatorID ids.ShortID, chainID ids.ID, op message.Op, uniqueRequestID ids.ID, timeoutHandler func(), ) (time.Time, bool)
RegisterRequest notes that we expect a response of type [op] from [validatorID] regarding chain [chainID]. If we don't receive a response in time, [timeoutHandler] is executed.
func (*Manager) RegisterRequestToUnreachableValidator ¶
func (m *Manager) RegisterRequestToUnreachableValidator()
RegisterRequestToUnreachableValidator registers that we would have sent a query to a validator but they are unreachable because they are bench or because of network conditions (e.g. we're not connected), so we didn't send the query. For the sake// of calculating the average latency and network timeout, we act as though we sent the validator a request and it timed out.
func (*Manager) RegisterResponse ¶
func (m *Manager) RegisterResponse( validatorID ids.ShortID, chainID ids.ID, uniqueRequestID ids.ID, op message.Op, latency time.Duration, )
RegisterResponse registers that we received a response from [validatorID] regarding the given request ID and chain.
func (*Manager) RemoveRequest ¶ added in v0.2.3
RemoveRequest clears the request with the provided ID.
func (*Manager) TimeoutDuration ¶
TimeoutDuration returns the current network timeout duration