From 0c258bdc4040fcc4ab590fc80dbcd2182b4c74ae Mon Sep 17 00:00:00 2001 From: Jason Ginchereau Date: Sat, 26 Aug 2017 15:44:43 -0700 Subject: 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 Reviewed-By: James M Snell --- src/node_api_types.h | 1 + 1 file changed, 1 insertion(+) (limited to 'src/node_api_types.h') diff --git a/src/node_api_types.h b/src/node_api_types.h index ac8482bf9d..574cb6ff98 100644 --- a/src/node_api_types.h +++ b/src/node_api_types.h @@ -16,6 +16,7 @@ typedef struct napi_ref__ *napi_ref; typedef struct napi_handle_scope__ *napi_handle_scope; typedef struct napi_escapable_handle_scope__ *napi_escapable_handle_scope; typedef struct napi_callback_info__ *napi_callback_info; +typedef struct napi_async_context__ *napi_async_context; typedef struct napi_async_work__ *napi_async_work; typedef struct napi_deferred__ *napi_deferred; -- cgit v1.2.3