-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
current uid is a stack #10
Labels
Comments
I think this should be fixed transitively via #16? |
I think they are quite unrelated. The fix is just: const currState = [root];
function asyncInit(uid, handle, provider, parentUid) {
// get parent state
const state = (parentUid === null ? currState[currState.length - 1] : stateMap.get(parentUid));
// add new state node
stateMap.set(uid, state.add(handle));
}
function asyncBefore(uid) {
const state = stateMap.get(uid);
state.before();
currState.push(state);
}
function asyncAfter(uid) {
const state = stateMap.get(uid);
state.after();
currState.pop();
} but I haven't been able to create a test script for it. |
Sorry, wrong issue. I think this should be fixed by the actual async_hooks impl? aka nodejs/node#8531 |
Yes, it provided an API for getting the contextual parent. |
Turns out that the basic |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
MakeCallback
is sometimes called synchronously, thusuid
can have multiple values in the same synchronous context.The text was updated successfully, but these errors were encountered: