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

kgo: add ctx field to client cfg #907

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

o-mago
Copy link

@o-mago o-mago commented Feb 14, 2025

Adds ctx field to allow custom contexts to be used by the client
For example, it allows the custom onAssigned func, added using OnPartitionsAssigned opt, to access a custom context and any propagated value inside (like tracers)

@o-mago
Copy link
Author

o-mago commented Feb 14, 2025

could you review it @twmb 😊?

@twmb
Copy link
Owner

twmb commented Feb 18, 2025

Looks good, can you update the Client.OptValue method to return this context?

@o-mago
Copy link
Author

o-mago commented Feb 18, 2025

done @twmb

@twmb
Copy link
Owner

twmb commented Mar 7, 2025

I'm slowly working on 1.19, I plan to merge this once gearing up to release.

@twmb
Copy link
Owner

twmb commented Mar 7, 2025

Is it worth it to add a Context() context.Context function to the client, so that the client can return the internal context (which will be this context, wrapped with a cancellation)?

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 this pull request may close these issues.

2 participants