LightArrayRevolverScheduler, see #2904
- based on a wheel (AtomicReferenceArray) from which atomic single-linked lists dangle - no locks - deterministic tests due to overridable time source - also bring docs up to date
This commit is contained in:
parent
9f2a0afc05
commit
8dea20a1f1
20 changed files with 863 additions and 202 deletions
|
|
@ -215,14 +215,14 @@ trait TestKitBase {
|
|||
* Note that the timeout is scaled using Duration.dilated,
|
||||
* which uses the configuration entry "akka.test.timefactor".
|
||||
*/
|
||||
def awaitCond(p: ⇒ Boolean, max: Duration = Duration.Undefined, interval: Duration = 100.millis) {
|
||||
def awaitCond(p: ⇒ Boolean, max: Duration = Duration.Undefined, interval: Duration = 100.millis, message: String = "") {
|
||||
val _max = remainingOrDilated(max)
|
||||
val stop = now + _max
|
||||
|
||||
@tailrec
|
||||
def poll(t: Duration) {
|
||||
if (!p) {
|
||||
assert(now < stop, "timeout " + _max + " expired")
|
||||
assert(now < stop, "timeout " + _max + " expired: " + message)
|
||||
Thread.sleep(t.toMillis)
|
||||
poll((stop - now) min interval)
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue