Skip to content

Why not make goroutine stoppable / cancellable? #64

@afarbos

Description

@afarbos

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions