Skip to content
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

Support generator functions in startSpan APIs #10772

Closed
Tracked by #9508
mydea opened this issue Feb 21, 2024 · 2 comments
Closed
Tracked by #9508

Support generator functions in startSpan APIs #10772

mydea opened this issue Feb 21, 2024 · 2 comments

Comments

@mydea
Copy link
Member

mydea commented Feb 21, 2024

Today, we do not support providing generator functions as a callback to startSpan or startSpanManual.

This is fundamentally a bit tricky, first because it is a bit tricky (but probably possible?) to detect if a generator function has been provided as a callback. But more fundamentally, when using this in node, execution context handling will not work as expected inside of the generator function (which is a known node issue).

Still it's not unreasonable to want to use something like this:

function*() {
  yield startSpan({ name: 'my span' }, function*() {
    yield waitForSomeTask();
   });
}

We should find some way to support this, either inside of startSpan or through a dedicated helper like startSpanGenerator (naming is hard, but you get the point...).

@AbhiPrasad
Copy link
Member

Related nodejs/node#42237

@AbhiPrasad AbhiPrasad added this to the 8.0.0 milestone Feb 23, 2024
@AbhiPrasad AbhiPrasad modified the milestones: 8.0.0, 9.0.0 Jun 4, 2024
@lforst lforst removed this from the 9.0.0 milestone Nov 13, 2024
@mydea
Copy link
Member Author

mydea commented Dec 11, 2024

I am closing this because we are not really planning any work on this for now.

@mydea mydea closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants