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

Is there a way to set a base/root context in river.NewClient()? #103

Closed
dhermes opened this issue Dec 10, 2023 · 2 comments
Closed

Is there a way to set a base/root context in river.NewClient()? #103

dhermes opened this issue Dec 10, 2023 · 2 comments

Comments

@dhermes
Copy link
Contributor

dhermes commented Dec 10, 2023

Similar to how it works on an http.Server (https://pkg.go.dev/net/http#Server)

Context: In our codebase we put some helpful logging-related values on a root context and then send that through into various handlers.

@dhermes dhermes changed the title Is there a way to set a base/root context? Is there a way to set a base/root context in river.NewClient()? Dec 10, 2023
@bgentry
Copy link
Contributor

bgentry commented Dec 10, 2023

Hi @dhermes, the context provided to Start is used as the base context for all other contexts in River, including the one provided to jobs. You should still see any context values present when your job runs.

@bgentry bgentry closed this as completed Dec 10, 2023
@dhermes
Copy link
Contributor Author

dhermes commented Dec 11, 2023

Thanks @bgentry!

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