diff options
author | Matteo Collina <hello@matteocollina.com> | 2018-05-04 09:00:07 +0300 |
---|---|---|
committer | Shelley Vohr <shelley.vohr@gmail.com> | 2020-02-17 23:38:51 +0300 |
commit | 6be51296e4e2a977c2c825719912bef1aa5b5bfc (patch) | |
tree | b505d22440fe283a8e7e1fddf8e1a600d4521ffd /src/async_wrap.h | |
parent | ba9fae058abd273934bf759ca4c89e060519c691 (diff) |
async_hooks: add executionAsyncResource
Remove the need for the destroy hook in the basic APM case.
Co-authored-by: Stephen Belanger <admin@stephenbelanger.com>
PR-URL: https://github.com/nodejs/node/pull/30959
Reviewed-By: Matteo Collina <matteo.collina@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Vladimir de Turckheim <vlad2t@hotmail.com>
Reviewed-By: Chengzhong Wu <legendecas@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Diffstat (limited to 'src/async_wrap.h')
-rw-r--r-- | src/async_wrap.h | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/async_wrap.h b/src/async_wrap.h index 58d6ca84db8..33bed41a643 100644 --- a/src/async_wrap.h +++ b/src/async_wrap.h @@ -134,8 +134,8 @@ class AsyncWrap : public BaseObject { void* priv); static void GetAsyncId(const v8::FunctionCallbackInfo<v8::Value>& args); - static void PushAsyncIds(const v8::FunctionCallbackInfo<v8::Value>& args); - static void PopAsyncIds(const v8::FunctionCallbackInfo<v8::Value>& args); + static void PushAsyncContext(const v8::FunctionCallbackInfo<v8::Value>& args); + static void PopAsyncContext(const v8::FunctionCallbackInfo<v8::Value>& args); static void AsyncReset(const v8::FunctionCallbackInfo<v8::Value>& args); static void GetProviderType(const v8::FunctionCallbackInfo<v8::Value>& args); static void QueueDestroyAsyncId( @@ -202,6 +202,7 @@ class AsyncWrap : public BaseObject { v8::Local<v8::Object> obj); bool IsDoneInitializing() const override; + v8::Local<v8::Object> GetResource(); private: friend class PromiseWrap; @@ -216,6 +217,7 @@ class AsyncWrap : public BaseObject { // Because the values may be Reset(), cannot be made const. double async_id_ = kInvalidAsyncId; double trigger_async_id_; + v8::Global<v8::Object> resource_; }; } // namespace node |