| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
Documentation for N-API Custom Asynchronous Operations incorrectly stated that async execution happens on the main event loop. Added details to napi_create_async_work about which threads are used to invoke the execute and complete callbacks. Fixes: nodejs#19071
| thread and executes in parallel with the main event loop thread. | ||
| - `[in] complete`: The native function which will be called when the | ||
| asynchronous logic is comple or is cancelled. | ||
| asynchronous logic is comple or is cancelled. The given function is called |
There was a problem hiding this comment.
should this be completed and not comple?
Sorry, something went wrong.
There was a problem hiding this comment.
Good find, that was a typo in the original documentation. Fixed that as well.
Sorry, something went wrong.
Documentation for napi_create_async_work was missing part of the word "completed" in the parameter documentation
| The simple asynchronous work APIs above may not be appropriate for every | ||
| scenario, because with those the async execution still happens on the main | ||
| event loop. When using any other async mechanism, the following APIs are | ||
| scenario. When using any other async mechanism, the following APIs are |
There was a problem hiding this comment.
Nit: async -> asynchronous?
Sorry, something went wrong.
There was a problem hiding this comment.
Fixed; expanded the abbreviations.
Sorry, something went wrong.
|
Text looks good to me in terms of style/grammar/etc. Pinging @nodejs/n-api to review for content. |
Sorry, something went wrong.
| - `[in] execute`: The native function which should be called to excute | ||
| the logic asynchronously. | ||
| the logic asynchronously. The given function is called from a worker pool | ||
| thread and executes in parallel with the main event loop thread. |
There was a problem hiding this comment.
@ebickle is it guaranteed to execute in parallel with the main event loop thread? Or is it more precise to say "can execute in parallel with the main event loop thread"? That is, is there a situation where the only thread available to do work in the thread pool is the main event loop thread?
Sorry, something went wrong.
There was a problem hiding this comment.
@digitalinfinity agree completely with the suggestion. Regardless of whether or not the execute function can ever run in the main event loop thread, it's never guaranteed to be executed in parallel due to the OS' context switching. Updated the documentation.
Sorry, something went wrong.
There was a problem hiding this comment.
Just one question- otherwise LGTM- thanks for the change!
Sorry, something went wrong.
There was a problem hiding this comment.
LGTM once @digitalinfinity's question is addressed.
Sorry, something went wrong.
Changed 'async' to 'asynchronous' in the documentation for Custom Asynchronous Operations. Changed "executes in parallel" to "can execute in parallel" for the documentation of napi_create_async_work execute parameter.
|
@digitalinfinity @mhdawson Improved the documentation based on the suggestions. I've posted it as a new commit, let me know if you'd like the commits to be manually squashed on my end. |
Sorry, something went wrong.
|
@ebickle we can squash as part of landing. |
Sorry, something went wrong.
Sorry, something went wrong.
Documentation for N-API Custom Asynchronous Operations incorrectly stated that async execution happens on the main event loop. Added details to napi_create_async_work about which threads are used to invoke the execute and complete callbacks. Changed 'async' to 'asynchronous' in the documentation for Custom Asynchronous Operations. Changed "executes in parallel" to "can execute in parallel" for the documentation of napi_create_async_work execute parameter. PR-URL: #19073 Fixes: #19071 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Documentation for N-API Custom Asynchronous Operations incorrectly stated that async execution happens on the main event loop. Added details to napi_create_async_work about which threads are used to invoke the execute and complete callbacks. Changed 'async' to 'asynchronous' in the documentation for Custom Asynchronous Operations. Changed "executes in parallel" to "can execute in parallel" for the documentation of napi_create_async_work execute parameter. PR-URL: nodejs#19073 Fixes: nodejs#19071 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Documentation for N-API Custom Asynchronous Operations incorrectly stated that async execution happens on the main event loop. Added details to napi_create_async_work about which threads are used to invoke the execute and complete callbacks. Changed 'async' to 'asynchronous' in the documentation for Custom Asynchronous Operations. Changed "executes in parallel" to "can execute in parallel" for the documentation of napi_create_async_work execute parameter. PR-URL: nodejs#19073 Fixes: nodejs#19071 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Documentation for N-API Custom Asynchronous Operations incorrectly stated that async execution happens on the main event loop. Added details to napi_create_async_work about which threads are used to invoke the execute and complete callbacks. Changed 'async' to 'asynchronous' in the documentation for Custom Asynchronous Operations. Changed "executes in parallel" to "can execute in parallel" for the documentation of napi_create_async_work execute parameter. PR-URL: nodejs#19073 Fixes: nodejs#19071 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Documentation for N-API Custom Asynchronous Operations incorrectly stated that async execution happens on the main event loop. Added details to napi_create_async_work about which threads are used to invoke the execute and complete callbacks. Changed 'async' to 'asynchronous' in the documentation for Custom Asynchronous Operations. Changed "executes in parallel" to "can execute in parallel" for the documentation of napi_create_async_work execute parameter. Backport-PR-URL: #19447 PR-URL: #19073 Fixes: #19071 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Documentation for N-API Custom Asynchronous Operations incorrectly stated that async execution happens on the main event loop. Added details to napi_create_async_work about which threads are used to invoke the execute and complete callbacks. Changed 'async' to 'asynchronous' in the documentation for Custom Asynchronous Operations. Changed "executes in parallel" to "can execute in parallel" for the documentation of napi_create_async_work execute parameter. Backport-PR-URL: #19265 PR-URL: #19073 Fixes: #19071 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Documentation for N-API Custom Asynchronous Operations incorrectly stated that async execution happens on the main event loop. Added details to napi_create_async_work about which threads are used to invoke the execute and complete callbacks. Changed 'async' to 'asynchronous' in the documentation for Custom Asynchronous Operations. Changed "executes in parallel" to "can execute in parallel" for the documentation of napi_create_async_work execute parameter. PR-URL: nodejs#19073 Fixes: nodejs#19071 Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
| Back | FazBrowse Home | New Git URL |
Documentation for N-API Custom Asynchronous Operations incorrectly stated that async execution happens on the main event loop. Added details to napi_create_async_work about which threads are used to invoke the execute and complete callbacks.
Fixes: #19071
Checklist
Affected core subsystem(s)
doc