blob: d5f18a6d543a6250bb2526fda671035166f4b543 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
package erratic
import "sync/atomic"
// Ready returns true if the number of received queries is in the range [3, 5). All other values return false.
// To aid in testing we want to this flip between ready and not ready.
func (e *Erratic) Ready() bool {
q := atomic.LoadUint64(&e.q)
if q >= 3 && q < 5 {
return true
}
return false
}
|