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

Replace ContextDeriver with context.WithoutCancel #428

Open
bluekeyes opened this issue Feb 28, 2025 · 0 comments · May be fixed by #430
Open

Replace ContextDeriver with context.WithoutCancel #428

bluekeyes opened this issue Feb 28, 2025 · 0 comments · May be fixed by #430

Comments

@bluekeyes
Copy link
Member

In Go 1.21, the context package got the context.WithoutCancel function, which creates a new context with all the same values as an existing context, but with an independent lifetime. This solves the same problem that I tried to solve with ContextDeriver.

It's easy enough to change the implementation of DefaultContextDeriver to use context.WithoutCancel and deprecate the other functionality, but I'd really like to remove this whole API. Internally, we don't use this at all and I couldn't find any public uses with Sourcegraph, so I think the impact would be minor. It should also be possible to move any custom functionality either into the handler or to a wrapper around the event dispatcher.

@bluekeyes bluekeyes linked a pull request Feb 28, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant