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

Why not make goroutine stoppable / cancellable? #64

Open
afarbos opened this issue May 16, 2022 · 0 comments
Open

Why not make goroutine stoppable / cancellable? #64

afarbos opened this issue May 16, 2022 · 0 comments
Assignees

Comments

@afarbos
Copy link

afarbos commented May 16, 2022

Your Question

This library start multiple process without a way to stop them using the context.Context and/or a Finalize() / Close() function(s).
Are there any reasons? Could this be added?

The document you expected this should be explained

I would expect every loop with goroutine to support context done, like:

select {
	case <-time.After(time.Duration(p.Config.RefreshInterval) * time.Second):
		// LOGIC
	case <-ctx.Done():
		return
}

And for the server to store it and expose the Close function.

Expected answer

Hopefully yes and I or someone else can do it.

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