4 ms·
Pretty sure there can be unexpected behavior if you wait too long before you do those awaits at the end.
by matt-attack 5y ago
Pretty sure there can be unexpected behavior if you wait too long before you do those awaits at the end.
- RedShift1 5y agoNo, why would there be?
- matt-attack 5y agoNode 16 will exit if an exception is thrown and not awaited for some finite period of time. So if your goal is to keep those promises in some cache and then resolve them later on at your leisure, you will find the entire node process will abort. There is a feature flag to restore the older behavior but it’s a pretty big gotcha.
- RedShift1 5y agoThere is no such finite period of time. You can call an async function and never await it. Exception handling is something completely different. Yes, if you call an async function and do not catch the exception, Node will stop. But that is independent of having called await or not. Whether or not you await something async does not affect exception behavior.