So one of the problems I'm having a hard time with when it comes to v8/nodejs is that sometimes you have to wait on something to do anything else at all. While it's certainly possible to block essentially by placing the rest of the script within the callback it's counterintutive and very messy. It doesn't really work class based programming either.I have a class I'll call Class A function constructor() { this.varible = "butts"; this.variable2 = 0; nonblocking_function(callback) { // does stuff to get data for variable 2 } the issue is I need variable2 set before I continue without placing the whole codepath within the callback
Submitted February 05, 2016 at 10:15PM by runny6play
No comments:
Post a Comment