Closed nickdesaulniers closed 5 years ago
Looks like those interfaces are deprecated in favor of ones that additionally pass a Nan::AsyncResource
.
https://github.com/nodejs/nan/blob/master/doc/callback.md#api_nan_callback https://github.com/nodejs/nan/blob/master/doc/node_misc.md#api_nan_make_callback
so src/node_nanomsg.cc:233 is easy; we already subclass Nan::AsyncWorker
, so just:
diff --git a/src/node_nanomsg.cc b/src/node_nanomsg.cc
index ab66db5..9b40b5e 100644
--- a/src/node_nanomsg.cc
+++ b/src/node_nanomsg.cc
@@ -230,7 +230,7 @@ public:
Local<Value> argv[] = { Nan::New<Number>(err) };
- callback->Call(1, argv);
+ callback->Call(1, argv, async_resource);
};
private:
is necessary. The change for poll_ctx.cc looks more involved, since we hand rolled a bit.
via
npm install
:https://github.com/nodejs/nan/blob/master/doc/node_misc.md#api_nan_make_callback