Skip to content

Commit 4274542

Browse files
addaleaxBethGriggs
authored andcommitted
src: deprecate AddPromiseHook()
This API was added to fill an use case that is served by `async_hooks`, since that has `Promise` support. Deprecate this, as the underlying `Isolate::SetPromiseHook()` may be removed in its current form in the future. Refs: https://docs.google.com/document/d/1g8OrG5lMIUhRn1zbkutgY83MiTSMx-0NHDs8Bf-nXxM/ PR-URL: #26529 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: James M Snell <jasnell@gmail.com>
1 parent 4285b57 commit 4274542

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/node.h

+4-3
Original file line numberDiff line numberDiff line change
@@ -661,9 +661,10 @@ struct async_context {
661661

662662
/* Registers an additional v8::PromiseHook wrapper. This API exists because V8
663663
* itself supports only a single PromiseHook. */
664-
NODE_EXTERN void AddPromiseHook(v8::Isolate* isolate,
665-
promise_hook_func fn,
666-
void* arg);
664+
NODE_DEPRECATED("Use async_hooks directly instead",
665+
NODE_EXTERN void AddPromiseHook(v8::Isolate* isolate,
666+
promise_hook_func fn,
667+
void* arg));
667668

668669
/* This is a lot like node::AtExit, except that the hooks added via this
669670
* function are run before the AtExit ones and will always be registered

0 commit comments

Comments
 (0)