3 ms·
Then the `try { ... } catch { heartbeat() }` pattern will emerge.
by eyelidlessness 6y ago
Then the `try { ... } catch { heartbeat() }` pattern will emerge.
- TeMPOraL 6y agoWhich is a sane pattern if a language has proper destructors (a seemingly non-existent thing in GC-enabled languages, unfortunately). In C++, you'd stack-allocate an object representing a spinner, that spawns said spinner in its constructor, and deletes it in its destructor. Then the spinner doesn't outlive the processing code, no matter what path execution took to end the processing. There are similar patterns in GC-enabled languages ("with" idiom). Async does throw a wrench into this a bit, though.
- eyelidlessness 6y agoThat’s a different pattern than I was trying to illustrate. I was demonstrating unsafely catching/ignoring/hiding errors and asserting health when it’s demonstrably not true