MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/javascript/comments/75nibr/javascripts_promise_is_memory_unsafe/do93qs1/?context=3
r/javascript • u/alexelcu • Oct 11 '17
77 comments sorted by
View all comments
8
Right, but the native await code handles tail recursion properly, no?
Also, did you try this with Bluebird, it might be smarter about forwarding resolutions?
6 u/alexelcu Oct 11 '17 No, that loop using await is not tail recursion and the return await sample also crashes.I have not tried with Bluebird. Will do so later, article talks about the standard Promise implementation. 2 u/w00t_loves_you Oct 12 '17 Well, thanks for the article, you got a decent amount of downvotes, but this is reddit ;)This discussion made me realize I am doing this in a task queue because I was assuming TCO, and I am using Bluebird so I lucked out!
6
No, that loop using await is not tail recursion and the return await sample also crashes.
return await
I have not tried with Bluebird. Will do so later, article talks about the standard Promise implementation.
Promise
2 u/w00t_loves_you Oct 12 '17 Well, thanks for the article, you got a decent amount of downvotes, but this is reddit ;)This discussion made me realize I am doing this in a task queue because I was assuming TCO, and I am using Bluebird so I lucked out!
2
Well, thanks for the article, you got a decent amount of downvotes, but this is reddit ;)
This discussion made me realize I am doing this in a task queue because I was assuming TCO, and I am using Bluebird so I lucked out!
8
u/w00t_loves_you Oct 11 '17
Right, but the native await code handles tail recursion properly, no?
Also, did you try this with Bluebird, it might be smarter about forwarding resolutions?