Promises are cool and all but they are so misleading. At a system level, code is put onto another thread. Node is magic. When you create a promise, the code block will execute on those threads assuming they can be created. The code can execute immediately or whenever. The important thing to remember is promises are called promises because NodeJS promises to join all active threads before the main process exits. Does that mean that promise will execute without failure? No. Does that mean Node will let your code finish executing? No. It means Node will try to clean up the garbage as best as it can.

--

--

Wade Zimmerman πŸ‘¨πŸ»β€πŸ’»
Wade Zimmerman πŸ‘¨πŸ»β€πŸ’»

Written by Wade Zimmerman πŸ‘¨πŸ»β€πŸ’»

I write to vent my frustrations and don’t think much before posting

No responses yet