summaryrefslogtreecommitdiff
path: root/src/node_api_types.h
diff options
context:
space:
mode:
authorJason Ginchereau <jasongin@microsoft.com>2017-08-26 15:44:43 -0700
committerMichael Dawson <mdawson@devrus.com>2017-09-14 16:05:46 -0400
commit0c258bdc4040fcc4ab590fc80dbcd2182b4c74ae (patch)
tree6e0ea3e5311bb931ebc469d839f3e95226fde06a /src/node_api_types.h
parent92e5f5cc09fdbf223a418aef1154b2b75b3f9dcd (diff)
downloadandroid-node-v8-0c258bdc4040fcc4ab590fc80dbcd2182b4c74ae.tar.gz
android-node-v8-0c258bdc4040fcc4ab590fc80dbcd2182b4c74ae.tar.bz2
android-node-v8-0c258bdc4040fcc4ab590fc80dbcd2182b4c74ae.zip
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>
Diffstat (limited to 'src/node_api_types.h')
-rw-r--r--src/node_api_types.h1
1 files changed, 1 insertions, 0 deletions
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;