He-Pin commented on code in PR #887:
URL: https://github.com/apache/incubator-pekko/pull/887#discussion_r1437498056
##########
actor/src/main/scala/org/apache/pekko/actor/LightArrayRevolverScheduler.scala:
##########
@@ -105,12 +105,14 @@ class LightArrayRevolverScheduler(config: Config, log:
LoggingAdapter, threadFac
override def scheduleWithFixedDelay(initialDelay: FiniteDuration, delay:
FiniteDuration)(runnable: Runnable)(
implicit executor: ExecutionContext): Cancellable = {
+ checkZeroPeriod(delay.toNanos)
checkMaxDelay(roundUp(delay).toNanos)
super.scheduleWithFixedDelay(initialDelay, delay)(runnable)
}
override def schedule(initialDelay: FiniteDuration, delay: FiniteDuration,
runnable: Runnable)(
implicit executor: ExecutionContext): Cancellable = {
+ checkZeroPeriod(delay.toNanos)
Review Comment:
I think we should add the check to `scheduleAtFixedRate` and
`scheduleWithFixedDelay`.
And inline the method,otherwise it will add a stackframe
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]