Documentation ¶
Index ¶
Constants ¶
View Source
const (
HillClimbingLimiter = iota
)
Variables ¶
View Source
var ErrReachLimitation = fmt.Errorf("reach limitation")
View Source
var (
Verbose = false
)
Functions ¶
func VerboseDebugf ¶
func VerboseDebugf(msg string, args ...interface{})
Types ¶
type HillClimbing ¶
type HillClimbing struct {
// contains filtered or unexported fields
}
HillClimbing is a limiter using HillClimbing algorithm
func (*HillClimbing) Acquire ¶
func (l *HillClimbing) Acquire() (Updater, error)
func (*HillClimbing) Inflight ¶
func (l *HillClimbing) Inflight() uint64
func (*HillClimbing) Remaining ¶
func (l *HillClimbing) Remaining() uint64
type HillClimbingOption ¶
type HillClimbingOption int64
const ( HillClimbingOptionShrinkPlus HillClimbingOption = -2 HillClimbingOptionShrink HillClimbingOption = -1 HillClimbingOptionDoNothing HillClimbingOption = 0 HillClimbingOptionExtend HillClimbingOption = 1 HillClimbingOptionExtendPlus HillClimbingOption = 2 )
type HillClimbingUpdater ¶
type HillClimbingUpdater struct {
// contains filtered or unexported fields
}
func NewHillClimbingUpdater ¶
func NewHillClimbingUpdater(limiter *HillClimbing) *HillClimbingUpdater
func (*HillClimbingUpdater) DoUpdate ¶
func (u *HillClimbingUpdater) DoUpdate() error
type Limiter ¶
func NewHillClimbing ¶
func NewHillClimbing() Limiter
Click to show internal directories.
Click to hide internal directories.