-
Notifications
You must be signed in to change notification settings - Fork 462
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Nan:AsyncProgressWorker equivalent? #473
Comments
I have exactly the same use case as @gorshkob-leanid |
@JipBoesenkool have you looked at the https://nodejs.org/api/n-api.html#n_api_asynchronous_thread_safe_function_calls as an option? Not sure if that will work for your use case but worth a look. |
I tried napi and it, it works. But it looks redundantly. Nan API is much more convenient in this case. |
To clarify case, I use system hook with own callback. So I need to pass values from this callback to js side. The code might be not pretty, because I have to recall(=learn) c++ basis after ages of oblivion: |
PR-URL: nodejs/node-addon-api#529 Fixes: nodejs/node-addon-api#473 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
PR-URL: nodejs/node-addon-api#529 Fixes: nodejs/node-addon-api#473 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
PR-URL: nodejs/node-addon-api#529 Fixes: nodejs/node-addon-api#473 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
PR-URL: nodejs/node-addon-api#529 Fixes: nodejs/node-addon-api#473 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
@jasongin could you reply to @ptgolden's question? I can find neither node-addon-api or n-api functions to implement
streaming worker
such as Nan::AsyncProgressWorkerThere is example of usage from a book: [factorization example | https://github.com/freezer333/nodecpp-demo/blob/master/streaming/examples/factorization/factorization.js].
In my case I need to hook some system events and pass them to js callback.
Originally posted by @gorshkov-leonid in #75 (comment)
The text was updated successfully, but these errors were encountered: