Closed MarlonPassos-git closed 1 day ago
Hey! There's a new requirement for PRs that introduce new features. Without this requirement met, we won't be able to merge this. Note that this PR can still be included in a beta
prerelease before this requirement is fulfilled.
⚠️ Note: You need to run git rebase main
before this file will appear locally.
@aleclarson about the next-minor.md
file, you can check if this is the expected pattern. Maybe we can add some examples in contributing.md
to make it easier for new contributors
Maybe we can add some examples in
contributing.md
to make it easier for new contributors
Great idea 👍
This was the expected format:
#### timeout
https://github.com/radashi-org/radashi/pull/250
But using #250
is also acceptable.
The idea is that a script will parse that out and fetch the documentation for each function. The parsing could be relatively loose, so an exact pattern is not strictly required.
If a PR is extending an existing function, I don't know if fetching the related docs will work (or at least, it won't be as easy), so the PR author might be on the hook for describing the new feature in next-minor.md
etc.
Name | Current |
---|---|
timeout: with default error message | 921.57 ops/sec ±0.41% |
timeout: with custom error message | 920.74 ops/sec ±0.42% |
timeout: with custom error function | 925.63 ops/sec ±0.74% |
Performance regressions of 30% or more should be investigated, unless they were anticipated. Smaller regressions may be due to normal variability, as we don't use dedicated CI infrastructure.
We don't benchmark async functions (or at least, we haven't been).
Thanks for everything, Marlon! 🚀
Summary
This PR introduces a timeout promise function similar to the delay function, but with the ability to reject upon timeout. It also supports custom error classes passing a function as a parameter.
Related issue, if any:
203
For any code change,
Does this PR introduce a breaking change?
No
Bundle impact
src/async/TimeoutError.ts
src/async/timeout.ts
[^1337]: Function size includes the
import
dependencies of the function.