-
Notifications
You must be signed in to change notification settings - Fork 459
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
AsyncWorker: add GetResult() method #512
Conversation
Adds an overridable `GetResult()` method, providing arguments to the callback invoked in `OnOK()`. Re: nodejs#231 (comment)
Hey @mhdawson / @gabrielschulhof , This is the implementation of the
Let me know what you guys think 👍 |
napi-inl.h
Outdated
} | ||
// The OnExecute method receives an napi_env argument. However, do NOT | ||
// use it within this method, as it does not run on the main thread and cannot | ||
// access the napi_env. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe use the following instead:
as it does not run on the main thread and must not run any method that would cause
JavaScript to run. In practice, this means that almost any use of napi_env will be incorrect.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@gabrielschulhof just want your input on the change to an array as well. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Adds an overridable `GetResult()` method, providing arguments to the callback invoked in `OnOK()`. Refs: #231 (comment) PR-URL: #512 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: NickNaso <nicoladelgobbo@gmail.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Landed as 717c9ab |
Adds an overridable `GetResult()` method, providing arguments to the callback invoked in `OnOK()`. Refs: nodejs/node-addon-api#231 (comment) PR-URL: nodejs/node-addon-api#512 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: NickNaso <nicoladelgobbo@gmail.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Adds an overridable `GetResult()` method, providing arguments to the callback invoked in `OnOK()`. Refs: nodejs/node-addon-api#231 (comment) PR-URL: nodejs/node-addon-api#512 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: NickNaso <nicoladelgobbo@gmail.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Adds an overridable `GetResult()` method, providing arguments to the callback invoked in `OnOK()`. Refs: nodejs/node-addon-api#231 (comment) PR-URL: nodejs/node-addon-api#512 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: NickNaso <nicoladelgobbo@gmail.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Adds an overridable `GetResult()` method, providing arguments to the callback invoked in `OnOK()`. Refs: nodejs/node-addon-api#231 (comment) PR-URL: nodejs/node-addon-api#512 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: NickNaso <nicoladelgobbo@gmail.com> Reviewed-By: Gabriel Schulhof <gabriel.schulhof@intel.com>
Adds an overridable
GetResult()
method, providing arguments to the callbackinvoked in
OnOK()
.Re: #231 (comment)