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

suggested breaking change: add context.Context support to API #182

Open
connorkuehl opened this issue Dec 16, 2022 · 1 comment
Open

suggested breaking change: add context.Context support to API #182

connorkuehl opened this issue Dec 16, 2022 · 1 comment

Comments

@connorkuehl
Copy link
Contributor

Client code would benefit a lot from context cancellation support. I suspect we could update the code generator to add context.Context parameters that many Go programmers might already be used to and thread those through to Libvirt.getResponse.

Perhaps this breaking change is the line we could cross to cut a v1 module of go-libvirt to avoid breaking client code in a confusing way.

@sam-github
Copy link
Contributor

I don't think it would have to be breaking, the non-ctx variants, and explicit timeout arg variants, could all be written backwards compatibly in terms of the APIs that have a ctx arg. Some of the golang core APIs did this, they have a ...WithCtx(ctx, ..) or just ...Ctx(ctx, ...) version.

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

No branches or pull requests

2 participants