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.

I’ve been thinking about it all morning, and I think that there’s a way to map async / await semantics onto new Duktape.Thread().resume() / Duktape.Thread.yield(). They have similar error-throwing behavior, and don’t have the weird .next() interface that generators have.

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:4
  • Comments:10 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Type1Jcommented, May 27, 2020

There’s not much chatter here. Is async/await support planned for an upcoming version?

0reactions
fatcerberuscommented, May 23, 2017

@svaarala Thinking about this now, assuming a Promise polyfill is provided, could one emulate await by:

// await prom;
prom.then(Duktape.Thread.resume.bind(null, thisThread));
Duktape.Thread.yield();

Or would that cause unforeseen issues (i.e. resuming a thread from the job queue).

Read more comments on GitHub >

github_iconTop Results From Across the Web

async function - JavaScript - MDN Web Docs - Mozilla
The async and await keywords enable asynchronous, promise-based behavior to be written in a cleaner style, avoiding the need to explicitly ...
Read more >
Async/await - The Modern JavaScript Tutorial
The async keyword before a function has two effects: ... The await keyword before a promise makes JavaScript wait until that promise settles,...
Read more >
JavaScript Async - W3Schools
The await keyword can only be used inside an async function. The await keyword makes the function pause the execution and wait for...
Read more >
Async/await - Wikipedia
In computer programming, the async/await pattern is a syntactic feature of many programming languages that allows an asynchronous, non-blocking function to ...
Read more >
Async/Await Function in JavaScript - GeeksforGeeks
Await : Await function is used to wait for the promise. It could be used within the async block only. It makes the...
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