From fcbcaded1a7ee5ba96d2544cd961ebe38909b992 Mon Sep 17 00:00:00 2001 From: Randall Degges Date: Fri, 12 Sep 2014 16:44:42 -0700 Subject: [PATCH] Making async.forever run... forever =) Previously, if async.forever was called, since it wasn't using `setImmediate` -- the max call stack size would be exceeded rather quickly. This fix introduces setImmediate behavior to prevent user-generated tasks from starving the event loop of resources. Fixes #437. --- lib/async.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/async.js b/lib/async.js index a13f83520..f0620717d 100755 --- a/lib/async.js +++ b/lib/async.js @@ -1103,7 +1103,7 @@ } throw err; } - fn(next); + setImmediate(fn, next); } next(); };