'Is it safe to call setImmediate recursively?
Is it safe to call setImmediate() recursively in (a reasonably up-to-date version of) NodeJS?
I have experimented with the following code and I haven't seen a stack overflow, or constant memory growth, but I can't find any documentation anywhere explicitly stating that this is safe to do:
let i = 0;
(function runTest() {
i++;
console.log(i);
setImmediate(runTest);
}());
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
