question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

async/delay DelayOptions should take an unref boolean

See original GitHub issue

With the new Deno.unrefTimer support in Deno v1.17, the DelayOptions interface for async/delay.ts should support a new boolean field unref

When unref is set to true, the id of the internal setTimeout should be automatically unreffed with Deno.unrefTimer(i)

Thus a call like this:

await delay(1000, {unref : true});

wouldn’t prevent Deno from exiting.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
iuioiuacommented, Aug 23, 2022

@kt3k, I believe this issue can be closed.

0reactions
kt3kcommented, Aug 14, 2022

@iuioiua

doing this will break browser compatibility unless a Deno namespace check is done.

Right, let’s check Deno namespace and keep the browser compatibility.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Timers | Node.js v19.3.0 Documentation
Calling immediate.unref() multiple times will have no effect. ... ref <boolean> Set to false to indicate that the scheduled Timeout should not require...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found