Documentation
¶
Index ¶
- Constants
- func AssignQueueLane(ctx context.Context, manager *Manager, counter PairLaneCounter, ...) error
- func IsLockContentionError(err error) bool
- func PairKeyForTransaction(manager *Manager, txn *model.Transaction) string
- func QueueLaneFromMetadata(meta map[string]interface{}) string
- func RecordContention(ctx context.Context, manager *Manager, source, destination, currency string, ...)
- func ResolveQueueLane(ctx context.Context, manager *Manager, counter PairLaneCounter, ...) (string, error)
- type Config
- type Manager
- func (m *Manager) ActivateHot(ctx context.Context, pairKey string) error
- func (m *Manager) Enabled() bool
- func (m *Manager) GetState(ctx context.Context, pairKey string) (State, error)
- func (m *Manager) HasRecentContention(ctx context.Context, pairKey string) (bool, error)
- func (m *Manager) HotQueueName() string
- func (m *Manager) PairKey(source, destination, currency string) string
- func (m *Manager) RecordContention(ctx context.Context, pairKey string) (int64, bool, error)
- func (m *Manager) SetNormal(ctx context.Context, pairKey string) error
- func (m *Manager) StartCoolingDown(ctx context.Context, pairKey string) error
- type PairLaneCounter
- type State
Constants ¶
View Source
const ( LaneNormal = "normal" LaneHot = "hot" )
View Source
const ( QueueLaneMetaKey = "queue_lane" QueuePairMetaKey = "queue_pair_key" )
Variables ¶
This section is empty.
Functions ¶
func AssignQueueLane ¶
func AssignQueueLane(ctx context.Context, manager *Manager, counter PairLaneCounter, txn *model.Transaction) error
func IsLockContentionError ¶
func PairKeyForTransaction ¶
func PairKeyForTransaction(manager *Manager, txn *model.Transaction) string
func QueueLaneFromMetadata ¶
func RecordContention ¶
func ResolveQueueLane ¶
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func NewManager ¶
func NewManager(client redis.UniversalClient, cfg Config) *Manager
func (*Manager) ActivateHot ¶
func (*Manager) HasRecentContention ¶
func (*Manager) HotQueueName ¶
func (*Manager) RecordContention ¶
type PairLaneCounter ¶
Click to show internal directories.
Click to hide internal directories.