Cap min timer interval at 1µs, thus improving compatibility with v0.4 #47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change only aims to improve compatibility with v0.4 which already has the same behavior:
event-loop/src/Timer/Timer.php
Line 9 in 164799f
Currently (v0.3 only), when passing an interval smaller than 1ms, we will throw an
InvalidArgumentException
.With this change applied, the minimum timer interval is capped at 1µs. This means that passing any smaller interval will still try to execute the timer in 1µs.
There are quite a few libraries that target both v0.3 and v0.4 of this component, so it makes sense to keep BC breaks between those versions to a minimum. I'll look into linking relevant tickets against this PR.
FWIW: No tests included because the v0.3 branch does not currently contain any tests unfortunately.