-
Notifications
You must be signed in to change notification settings - Fork 623
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(async): add deadline
to async module
#1022
Conversation
96bc133
to
1600203
Compare
I'll squash commits once reviews are completed. |
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.
There's just a small thing to fix in the docs, otherwise LGTM
async/README.md
Outdated
import { deadline } from "https://deno.land/std/async/mod.ts"; | ||
|
||
const delayedPromise = delay(1000); | ||
// Above throws `DeadlineError` after 10 ms |
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.
Except it's not above anymore 😉
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.
Oops. I'll reword.
Also, just make sure you rebase, but you don't have to squash, we can do it on merge ourselves |
93566d6
to
63a4edf
Compare
Rebase & force pushed 👍 |
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.
LGTM, thanks a lot for the contribution!
timeout
to async moduledeadline
to async module
The `deadline` is added from [email protected] denoland/std#1022
Hi, I'm not sure if you like the idea but I added a
timeout
function to theasync
module while simple code withdelay(100).then(() => new Error("Timeout"))
would cause the following errorAdded
timeout
function callclearTimeout
to avoid such kind of error.Please close this PR if it does not suit the std requirements.