Add Promise Hooks API with Promise continuation tracking
Los mantenedores suelen responder en 3 días
Nadie ha tomado este issue todavía.
Evaluación
- Dificultad
- 5/5
- Tiempo estimado
- Más de una semana
- Aptitud para principiantes
- 25/100
Línea de trabajo
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.
Escrito por el modelo de indexación a partir del texto del issue.
Descripción
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.
- Lenguaje dominante
- C
- Estrellas
- 11.1k
- Forks
- 1.2k
- Merge medio
- 11 h 20 min
- PR fusionados (30 d)
- 1
Preparar el entorno
Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.
Primeros pasos
- Lee el issue completo y luego la guía de contribución del proyecto.
- Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
- Haz un fork del repositorio y trabaja en una rama.
- Abre un pull request que haga referencia al número del issue.
Más de bellard/quickjs
-
Dificultad 3/5 1-2 días Aptitud para principiantes 68/100
Los mantenedores suelen responder en 3 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 54/100
Los mantenedores suelen responder en 3 días
-
Dificultad 5/5 Más de una semana Aptitud para principiantes 30/100
Los mantenedores suelen responder en 3 días
-
Dificultad 4/5 3-5 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 3 días
-
Dificultad 3/5 1-2 días Aptitud para principiantes 55/100
Los mantenedores suelen responder en 3 días
Todos los issues de bellard/quickjs
Issues similares
-
Dificultad 2/5 1-3 horas Aptitud para principiantes 72/100
JustAResearcher/gpu-unlock-ada#145 · 1 reacción ·
Los mantenedores suelen responder en 1 día
-
[Success Image Report]: GXDE OSAbierto
Dificultad 1/5 Menos de una hora Aptitud para principiantes 62/100
-
`PiecewiseChebyshevGate` produces incorrect target rotations outside the supplied breakpointsAbiertobug mod: circuit
Dificultad 2/5 1-3 horas Aptitud para principiantes 84/100
Los mantenedores suelen responder en 1 día
-
area:tools type:bug
Dificultad 2/5 1-3 horas Aptitud para principiantes 78/100
Los mantenedores suelen responder en 1 día
-
Offline trigger silently replaces an existing /system-update link from another tool (dnf5 offline)Abierto
Dificultad 2/5 1-3 horas Aptitud para principiantes 76/100
PackageKit/PackageKit#1040 ·
Los mantenedores suelen responder en 1 día