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 Converter safe for use by multiple goroutines? #32

Open
inliquid opened this issue Apr 19, 2021 · 1 comment
Open

Is Converter safe for use by multiple goroutines? #32

inliquid opened this issue Apr 19, 2021 · 1 comment
Labels
docs improve documentation tests improve the tests

Comments

@inliquid
Copy link

This should be documented. Is it safe to use by multiple goroutines? Am I expected to use one single instance of Converter with same configuration across my app, or to create new in each case? What's the design, what are performance considerations?

PS: there is sync.RWMutex within Converter struct, so the answer is probably yes, but, again, this should be documented to not guess or reverse engineer.

@JohannesKaufmann
Copy link
Owner

@inliquid good catch, I definitely have to add documentation for this.

It's safe to use by multiple goroutines and you can use a single instance or multiple. Whatever you want.

There seems to be one test for that, but I definitely have to add more 🤔

@JohannesKaufmann JohannesKaufmann added docs improve documentation tests improve the tests labels May 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs improve documentation tests improve the tests
Projects
None yet
Development

No branches or pull requests

2 participants