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

Future direction: Non-copyable Span #126

Open
stevapple opened this issue May 25, 2023 · 1 comment
Open

Future direction: Non-copyable Span #126

stevapple opened this issue May 25, 2023 · 1 comment
Labels
1 - triaged Task makes sense, is well defined, and is ready to be worked on
Milestone

Comments

@stevapple
Copy link
Contributor

stevapple commented May 25, 2023

Given that Span should be ended exactly once, and should not be shared between subprocesses or preserved after termination, it seems a potential client of the recently accepted SE-0390. With Swift 5.9+ we can mark Span as non-copyable, and only allow the operation to “borrow” the span. span.end() will consume the span. We can also add span.end() in deinit to automatically terminate the span.

Note that this is unfortunately very breaking. Haven’t thought about if there’s a way to land this safely in the 1.x period.

@ktoso
Copy link
Member

ktoso commented May 25, 2023

Yeah it would be nice but I'm a bit worried about just doing it for 5.9+ for example...

Definitely worth keeping in mind so let's keep this issue open

@ktoso ktoso added this to the x.x - future milestone May 25, 2023
@ktoso ktoso added the 1 - triaged Task makes sense, is well defined, and is ready to be worked on label May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
1 - triaged Task makes sense, is well defined, and is ready to be worked on
Projects
None yet
Development

No branches or pull requests

2 participants