You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
--
We are currently working on developing a nodejs compatible async_hooks module for LLRT.
We are getting close to completing the basic implementation, but I'm having trouble figuring out when to discard the ID information stored on the Rust side.
In the current implementation, the ID information created at the Init event is deleted when the resolve event occurs in the Promise Hook. However, if the events occur in the order before->resolve->after, the ID cannot be obtained in the after event.
I think there are a few solutions.
Give up on deleting the ID information (however, the longer the execution time, the more memory it consumes)
Receive an event when the Promise object is cleaned up. The promise object just before destruction is passed as an argument.
I think nodejs has a function for the latter as a destroy event, but is it possible to implement a similar event hook in quickjs? It would be great if there was a destroy version of a function like the already existing promise_rejection_tracker. It's something like promise_cleanup_tracker.
NOTE: For some reason, promise_rejection_tracker has not been exposed by rquickjs, so I'm not sure if it's a similar function...
The text was updated successfully, but these errors were encountered:
nabetti1720
changed the title
Is it possible to hook into the moment a promise object is destroyed?
Is it possible to hook into the moment a promise object is clean up?
Apr 27, 2025
Uh oh!
There was an error while loading. Please reload this page.
Related #1030
Related awslabs/llrt#947
--
We are currently working on developing a nodejs compatible
async_hooks
module for LLRT.We are getting close to completing the basic implementation, but I'm having trouble figuring out when to discard the ID information stored on the Rust side.
In the current implementation, the ID information created at the
Init
event is deleted when theresolve
event occurs in the Promise Hook. However, if the events occur in the order before->resolve->after, the ID cannot be obtained in theafter
event.I think there are a few solutions.
Give up on deleting the ID information (however, the longer the execution time, the more memory it consumes)
Receive an event when the Promise object is cleaned up. The promise object just before destruction is passed as an argument.
I think nodejs has a function for the latter as a
destroy
event, but is it possible to implement a similar event hook in quickjs? It would be great if there was adestroy
version of a function like the already existingpromise_rejection_tracker
. It's something likepromise_cleanup_tracker
.NOTE: For some reason,
promise_rejection_tracker
has not been exposed by rquickjs, so I'm not sure if it's a similar function...The text was updated successfully, but these errors were encountered: