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

Stop() -> context.Cancel #70

Open
eikenb opened this issue Oct 12, 2021 · 1 comment
Open

Stop() -> context.Cancel #70

eikenb opened this issue Oct 12, 2021 · 1 comment
Labels
enhancement New feature or request thinking Thinking about this

Comments

@eikenb
Copy link
Contributor

eikenb commented Oct 12, 2021

Consider the API change to remove all the Stop() methods and replace them with a passed in Context that is cancelled. This seems like it would be a cleaner API and fits with more modern/common Go practices that would be good to emulate.

@eikenb eikenb added enhancement New feature or request thinking Thinking about this labels Oct 12, 2021
@eikenb
Copy link
Contributor Author

eikenb commented Oct 12, 2021

Consider using https://pkg.go.dev/golang.org/x/sync/errgroup along with Run(ctx) to wait for all of them to shutdown. The Group.Go method will generally call the Run(ctx) .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request thinking Thinking about this
Projects
None yet
Development

No branches or pull requests

1 participant