3 ms·
My bad, I was probably a bit aggressive and didn't read through. Thank you for correcting a few points. However, I'm still convinced that calling Promises "mem
by weddpros 9y ago
My bad, I was probably a bit aggressive and didn't read through. Thank you for correcting a few points.
However, I'm still convinced that calling Promises "memory unsafe" is largely incorrect:
- if it wasn't for the setImmediate, I insist the callback version would cause a stack overflow
- you can't create an infinite number of objects (promises in this case) linked to each other without expecting a memory overflow. If it works in the Future example, it means the Futures are somehow not connected to each other, which must violate the contract for Promises. Can a Future object be resolved/flatMapped more than once without rerunning, ie. does it cache its value? I suspect this is the difference between a Promise and a Future...
- "You can't have infinite loops with Promises" would make a better title
I'm sorry, however, for trolling.
Cheers