Add support for waitUntil accepting an async function?
See original GitHub issueHi,
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:
- Created 5 years ago
- Comments:6 (3 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I primarily needed the repeated truthy checks of waitUntil.
where
someAsyncTruthynessCheck
is an async function that return true after a while/couple executions.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…