Commit Graph

4 Commits

Author SHA1 Message Date
Jason Ginchereau
0c258bdc40 n-api: Context for custom async operations
- Add napi_async_context opaque pointer type.
   (If needed, we could later add APIs for getting the async IDs
   out of this context.)
 - Add napi_async_init() and napi_async_destroy() APIs.
 - Add async_context parameter to napi_make_callback().
 - Add code and checks to test_make_callback to validate async context
   APIs by checking async hooks are called with correct context.
 - Update API documentation.

PR-URL: https://github.com/nodejs/node/pull/15189
Fixes: https://github.com/nodejs/node/issues/13254
Reviewed-By: Michael Dawson <michael_dawson@ca.ibm.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-09-14 16:05:46 -04:00
Hitesh Kanwathirtha
73d9c0f903 test: port test for make_callback to n-api
Improved test coverage for napi_make_callback by porting the
existing addons/make_callback test to n-api

PR-URL: https://github.com/nodejs/node/pull/12409
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
2017-05-06 12:24:43 -04:00
James M Snell
6c606916db Revert "test: port test for make_callback to n-api"
This reverts commit 70b51c8cc3.

PR-URL: https://github.com/nodejs/node/pull/12475
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
2017-04-17 16:49:22 -07:00
Hitesh Kanwathirtha
70b51c8cc3 test: port test for make_callback to n-api
Improved test coverage for napi_make_callback by porting the
existing addons/make_callback test to n-api

PR-URL: https://github.com/nodejs/node/pull/12409
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2017-04-17 15:01:22 -07:00