Skip to content

Is it possible to hook into an asynchronous function? #1030

@nabetti1720

Description

@nabetti1720

Hello everyone, I'm part of an experimental project called LLRT. As you know, LLRT uses quickjs-ng through RquickJS (Rust binding). I'm very grateful to be able to use such a great js engine.

Currently, we are trying to implement async_hooks, which is one of the nodejs modules. A draft has been made, but we want to make it better.

The current implementation creates hooking points for Promise, setTimeout, and setImmediate by patching JavaScript, but we would prefer something more native.

Current Implementation :
https://github.com/awslabs/llrt/pull/947/files#diff-801982e5802bc4502f37e9606801a09f83274a59675f658ee91eac80c54925a5

Is there a better way?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions