-
Notifications
You must be signed in to change notification settings - Fork 25
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
feat: add timeout
function
#250
feat: add timeout
function
#250
Conversation
tests/async/timout.test.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The timeout.test.ts
is misspelled as timout.test.ts
🙃
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
|
@aleclarson about the |
Great idea 👍 This was the expected format: #### timeout
https://github.com/radashi-org/radashi/pull/250 But using 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 |
Benchmark Results
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). |
444fe2b
to
d6cff01
Compare
Thanks for everything, Marlon! 🚀 |
A stable release To install: pnpm add [email protected] |
Tip
The owner of this PR can publish a preview release by commenting
/publish
in this PR. Afterwards, anyone can try it out by runningpnpm add radashi@pr<PR_NUMBER>
.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
Footnotes
Function size includes the
import
dependencies of the function. ↩