async.queue with async arrow function without callback doesn't work
See original GitHub issueWhat version of async are you using? 3.2.0
Which environment did the issue occur in (Node/browser/Babel/Typescript version) Node.js
What did you do? Please include a minimal reproducible case illustrating issue.
// Some code has been abbreviated for legibility
// Cleanup lingering test data
before(async () => {
const docs = await cosmosClient.queryAll(...);
const q = async.queue(async (task) => {
await cosmosClient.deleteItem(task.doc.id);
}, 10);
q.push(docs.map((doc, idx) => ({ doc, idx })));
await q.drain();
});
What did you expect to happen? all documents added to queue to be processed and for test suite to continue
What was the actual result? only first 10 documents are processed and then Node.js exists after a bit of time.
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:7
Top Results From Across the Web
async.queue with async handler function - callback argument ...
When I remove async /await from the top function section, it works, but I can't call my long-running task :-( I have no...
Read more >41 Async functions - Exploring JS
The reason is that normal arrow functions don't allow await inside their bodies. OK, let's try an async arrow function then: async function...
Read more >How to use the async.queue function in async - Snyk
To help you get started, we've selected a few async.queue examples, based on popular ways it is used in public projects.
Read more >Understanding the Event Loop, Callbacks, Promises, and ...
An async function can handle a promise called within it using the await operator. await can be used within an async function and...
Read more >caolan/async - Gitter
Hi @nikkitan I think the short answer is no, the entire library has not been merge into the latest version onf javascript. the...
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
Yep, that’s correct. If you’re using a recent version of Node (> 8.x), you can probably set TS’s target to preserve
async
functions/I set in
tsconfig.json
(or higher)