// CanClaim rejects tasks for a period of time if the last balance released
// tasks. Otherwise all tasks are accepted.
CanClaim rejects tasks for a period of time if the last balance released
tasks. Otherwise all tasks are accepted.
// CanClaim rejects tasks for a period of time if the last balance released // tasks . Otherwise all tasks are accepted .
func (e *FairBalancer) CanClaim(task Task) (time.Time, bool) {
	if e.delay.After(time.Now()) {
		return e.delay, false
	}
	n := len(e.bc.Tasks())
	time.Sleep(time.Duration(n>>2) * time.Millisecond)
	return NoDelay, true
}
func ( e * FairBalancer ) CanClaim ( task Task ) ( time . Time , bool ) { if e . delay . After ( time . Now ( ) ) { return e . delay , false } n := len ( e . bc . Tasks ( ) ) time . Sleep ( time . Duration ( n >> 2 ) * time . Millisecond ) return NoDelay , true }
CanClaim rejects tasks for a period of time if the last balance released
tasks.
CanClaim rejects tasks for a period of time if the last balance released tasks .
// Return delay set by Balance() // Sleep proportional to number of tasks