async.forever error in 2.3.0
See original GitHub issueWhat version of async are you using? 2.3.0 Which environment did the issue occur in (Node version/browser version) NodeJs >= 7.6 What did you do? Please include a minimal reproducable case illustrating issue. I have a function that works for async 2.1.5
_async.forever(async function(next) {
try {
// do something
next();
} catch (err) {
next(err);
}
}
What did you expect to happen?
This function should run the async callback function forever…I am using NodeJs >= 7.6 so async
is supported natively…
What was the actual result?
After upgrading to 2.3.0, now I get this error
TypeError: next is not a function
Issue Analytics
- State:
- Created 6 years ago
- Comments:6
Top Results From Across the Web
async - Documentation - GitHub Pages
A callback which is called when all iteratee functions have finished, or an error occurs. Invoked with (err). Returns: a promise, if a...
Read more >neo-async - npm
Neo-Async is thought to be used as a drop-in replacement for Async, it almost fully covers its functionality and runs faster.
Read more >async - NPM Package Overview - Socket.dev
Async is a utility module which provides straight-forward, powerful functions for working with asynchronous JavaScript. Although originally ...
Read more >About — python-logstash-async 2.5.0 documentation
While FileBeat provides similar features like python-logstash-async , there are also a few ... Otherwise retrying happens forever on non-recoverable errors.
Read more >Easier Node.js streams via async iteration - 2ality
Throws if there are errors. await finished(writable); } await writeIterableToFile( ['One', ' line of text ...
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
Perhaps we should make it more clear in the docs that a final callback isn’t passed to an
async
function.@aearly
Thanks for the response. I did figure out the throw way to break the forever loop. Although, I used
throw ("true")
& then checked iferror. message === "true"
in mycatch
block.Maybe
throw ( false )
won’t neederror. message
verification. Will try later.Also, regarding your
break
solution, that is what I tried first, but node gave error:Invalid break statement
& so I used forever in the first place.Anyways, thanks again for the response. Using throw does work as a workaround to the next callback.