Closed mhdawson closed 4 years ago
During today's meeting @NickNaso and @gabrielschulhof agreed that it is reasonable to add node-addon-api equivalents to the Nan::AsyncWorker
variants. We could implement them using napi_threadsafe_function
.
A proposal for an AsyncWorker
that uses the Promise
interface is made here: https://github.com/nodejs/node-addon-api/issues/231#issuecomment-496529366
So we have an issue for ProgressWorker but not PromiseWorker. We need to open an issue in node-addon-api for creating a PromiseWorker equivalent.
Seems like the only variant we need to prioritize ProgressWorker as Nan does not have PromiseWorker. Since we have nodejs/node-addon-api#473 I think we are good in terms of issues in the node-addon-api. We have tagged it as help needed for now.
Just found https://github.com/nodejs/node-addon-api/pull/477 noted that node-addon-api would prefer additional packages on topics not just a wrapper of n-api. Would AsyncWorker variants be considered merely additions to node-addon-api usage patterns but not wrappers of n-api?
@legendecas the exception for "additions" that we've made while developing node-addon-api is that in order to facilitate transition from nan to node-addon-api, if there is functionality in nan then we've tried to have corresponding functionality in node-addon-api where it makes sense.
PR to add AsyncProgressWorker: https://github.com/nodejs/node-addon-api/pull/529
There is also AsyncProgressQueueWorker which should be addressed before we close this issue. It is part of nan so we should consider adding it to N-API as well.
This is a PR doing that: https://github.com/nodejs/node-addon-api/pull/585
PR landed, closing
See https://github.com/nodejs/node-addon-api/issues/473