#20573 Fixing wrong initial buffer sizes in delay, and one logic bug

This commit is contained in:
Endre Sándor Varga 2016-05-24 11:42:17 +02:00
parent 03395d5739
commit 14b70836a7
3 changed files with 39 additions and 5 deletions

View file

@ -1125,7 +1125,7 @@ private[stream] final class Delay[T](d: FiniteDuration, strategy: DelayOverflowS
case Backpressure throw new IllegalStateException("Delay buffer must never overflow in Backpressure mode")
}
else {
grabAndPull(strategy != Backpressure || buffer.capacity < size - 1)
grabAndPull(strategy != Backpressure || buffer.used < size - 1)
if (!isTimerActive(timerName)) scheduleOnce(timerName, d)
}
}