-
-
Notifications
You must be signed in to change notification settings - Fork 127
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
periodic timer with the interval of zero #236
Comments
To be honest, I'm not sure, adding a periodic timer with an interval of I'm assuming you want to have that function called a lot, and guessing 100 times a second is enough then using |
in the path : React\EventLoop\Timer\Timer
There is a piece of logic in the timer class constructor that if the time is less than the minimum time, the minimum time is selected. But by selecting zero time, the timer no longer works periodically. And calls the callback only once Even if I choose very small number instead of zero, the timer works periodically
This only happens when ExtEvLoop is used and StreamSelectLoop does not have this problem. |
@my-random-username Thanks for reporting what sounds like a bug in the I agree that using a zero interval is rarely useful but may still happen in practice. As a counter measure, it looks like this is easy to work around by using a non-zero interval as suggested above. I don't currently have access to a system with |
The ExtEvLoop implementation did not take into account the adjusted min bounded $interval stored in Timer. EvTimer was being initialised with a repeat value of 0, completing after the first invocation of the timer. A simple patch is proposed in PR #243 |
Is this normal? periodic timer with zero value is executed only once . and never executes again !
the out put :
The text was updated successfully, but these errors were encountered: