Add Promise Hooks API with Promise continuation tracking
メンテナーはふだん 3 日以内に返信
まだ誰も着手していません。
評価
調査の方向性
Read the referenced quickjs-ng PR #1033 and issue #1740 to understand the proposed API and missing continuation events. Then trace Promise reaction jobs and async/await resumptions in QuickJS’s C implementation; the issue does not name source files or tests. Done means providing the hooks API and emitting before/after events consistently for then(), catch(), finally(), and resumed await continuations.
索引モデルが issue の本文から書いたものです。
説明
Description
I would like to request the addition of a Promise Hooks API to QuickJS, similar to the implementation introduced in quickjs-ng.
The implementation in quickjs-ng provides embedders with a way to track Promise lifecycles and execution, following the V8 PromiseHook API model.
Reference:
Motivation
Promise execution tracking is useful for embedders that need to implement async context propagation, execution tracking, or Node.js-compatible APIs such as async_hooks.
In particular, being able to observe Promise creation and execution boundaries allows embedders to associate asynchronous operations with their corresponding execution contexts.
Additional Requirement: Promise Continuation Hooks
In addition to porting the Promise Hooks implementation from quickjs-ng, I would like to request that the behavior of JS_PROMISE_HOOK_BEFORE and JS_PROMISE_HOOK_AFTER be considered for Promise continuations.
As discussed in quickjs-ng issue #1740, these hooks are currently not emitted when normal Promise reaction jobs are executed.
For example:
const promise = Promise.resolve();
promise.then(() => {
console.log("continuation");
});
When the Promise reaction job is executed, JS_PROMISE_HOOK_BEFORE and JS_PROMISE_HOOK_AFTER should be emitted around the execution of the continuation.
The same consideration should apply to continuations resumed after await, as well as then(), catch(), and finally().
Expected Behavior
I would like to see:
- A Promise Hooks API equivalent to the implementation in quickjs-ng PR #1033.
JS_PROMISE_HOOK_BEFOREandJS_PROMISE_HOOK_AFTERevents for normal Promise continuations.- Consistent hook behavior for Promise reactions and async/await resumptions.
The goal is to provide embedders with sufficient information to track Promise execution and correctly propagate asynchronous execution contexts.
Thank you for considering this request.
- 主要言語
- C
- スター
- 11.1k
- フォーク
- 1.2k
- 平均マージ
- 11時間 20分
- マージ済み PR(30日)
- 1
環境構築
このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
bellard/quickjs のほかの issue
-
難易度 3/5 1〜2日 初心者へのやさしさ 68/100
メンテナーはふだん 3 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 54/100
メンテナーはふだん 3 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 30/100
メンテナーはふだん 3 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
メンテナーはふだん 3 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 55/100
メンテナーはふだん 3 日以内に返信
bellard/quickjs の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
JustAResearcher/gpu-unlock-ada#145 · リアクション 1 件 ·
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 62/100
-
bug mod: circuit
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
メンテナーはふだん 1 日以内に返信
-
area:tools type:bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
Offline trigger silently replaces an existing /system-update link from another tool (dnf5 offline)オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
PackageKit/PackageKit#1040 ·
メンテナーはふだん 1 日以内に返信