Skip to content

Commit 6a895a3

Browse files
Add comments.
1 parent fc5d7f2 commit 6a895a3

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/module.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,17 @@ struct Terminator {
3232
bool blocky = false;
3333
#endif
3434

35+
/* Start termination asynchronously so we can detect if it takes long
36+
and should warn the user about this default blocking behaviour. */
3537
auto terminate = std::async(std::launch::async, [&] {
3638
auto err = zmq_ctx_term(context);
3739
assert(err == 0);
3840
});
3941

4042
using namespace std::chrono_literals;
4143
if (terminate.wait_for(500ms) == std::future_status::timeout) {
44+
/* We can't use process.emitWarning, because the Node.js runtime
45+
has already shut down. So we mimic it instead. */
4246
fprintf(stderr,
4347
"(node:%d) WARNING: Waiting for queued ZeroMQ messages to be "
4448
"delivered.%s\n",

0 commit comments

Comments
 (0)