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.

Add support for waitUntil accepting an async function?

See original GitHub issue

Hi, I wanted to use waitUntil and pass an async function as the callback. It looks like this isn’t currently supported. Is this something you would be interested in supporting?

If so I can try to open a PR which implements Promise support in waitUntil.

Issue Analytics

  • State:open
  • Created 5 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
makepaniccommented, Feb 28, 2019

I primarily needed the repeated truthy checks of waitUntil.

await waitUntil(async () => 
  await someAsyncTruthynessCheck());

where someAsyncTruthynessCheck is an async function that return true after a while/couple executions.

0reactions
rwjbluecommented, Aug 6, 2019

FWIW, I’m not opposed to adding support for waitUntil to handle async functions. If someone wants to pick that up, we can try to work out the details in a PR…

Read more comments on GitHub >

github_iconTop Results From Across the Web

JavaScript how to use event.waitUntil() to wait for an async ...
An async function isn't a promise, it's a function that returns a promise. Call your function and pass the promise it returns into...
Read more >
Async/await - The Modern JavaScript Tutorial
The syntax: // works only inside async functions let value = await promise; The keyword await makes JavaScript wait until that promise settles ......
Read more >
async function - JavaScript - MDN Web Docs - Mozilla
The async function declaration declares an async function where the await keyword is permitted within the function body. The async and await ...
Read more >
Use 'Promises' | Async/Await | in place of JavaScript Callbacks.
Adding a word `async` before any function means that function will always returns a promise. `await` works only inside `async` functions, and `await`...
Read more >
JavaScript async and await - in plain English, please
The async keyword is for a function that is supposed to perform an asynchronous operation. It means the function may be taking a...
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