-
Notifications
You must be signed in to change notification settings - Fork 263
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
Node domains only work when then-ing resolved promised #239
Comments
thanks for reporting this. related solution on another library: petkaantonov/bluebird#152 I should have time an evening this week, but if someone beats me to it, I'll be forever indebted. |
There's a simpler solution, just call process.nextTick every time instead of saving in a var. |
@domenic orly? |
@domenic im a domain noob, but I don't think that is a problem as |
I believe I have a clear grasp on the issue and the solution. I'll likely through together a good set of tests, and work on this at some point when i have time. |
Sorry I haven't gotten to this yet, I will try to soon. |
as domains are stability 2 and the performance implications of doing this naively are non-trivial this is honestly pretty low priority for me. |
@domenic i'll implement this if you tell me i should (with good reason) |
Nah From: Stefan Pennermailto:notifications@github.com @domenichttps://github.com/domenic i'll implement this if you tell me i should — |
I am experiencing some issues around node domains and the timing of when
then
is called on a Promise.Basically, all continuations created before the Promise is resolved loose their domain, and everything created after the Promise is resolved stay in the same domain.
Output:
As you can see, only the continuation that was created after the Promise had already been resolved works correctly.
The text was updated successfully, but these errors were encountered: