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

Long-running tasks should listen to context cancellations #41

Open
miparnisari opened this issue Jul 29, 2024 · 1 comment
Open

Long-running tasks should listen to context cancellations #41

miparnisari opened this issue Jul 29, 2024 · 1 comment

Comments

@miparnisari
Copy link

miparnisari commented Jul 29, 2024

https://go.dev/blog/context

For example when writing a web server (https://grpc.io/docs/languages/go/quickstart/#update-the-server), every function receives ctx as a first parameter.

https://pkg.go.dev/context

The chain of function calls between them must propagate the Context

https://stackoverflow.com/q/61707002/1623249

The common pattern is to pass it to every method. Be explicit.

@robpike
Copy link
Collaborator

robpike commented Jul 29, 2024

An interesting point but I'm not sure it's at proverb level.

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