-
Notifications
You must be signed in to change notification settings - Fork 829
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
Not thread safe #68
Comments
One way I got it working was to wrap a mutex around calls to BroadcastTo. Another option would be to set up a buffered channel that a worker reads from and emits broadcasts from structs/data in the channel that way it doesn't block senders trying to send broadcasts. |
I will try to figure out how to do it right. |
I fixed the race condition in broadcast (Join/Send/Leave), but I couldn't find any others running the example app. |
Closing this issue because it is very broad. If you have any specific races please open separate tickets for them so it's easier to take a look at. |
The code is vulnerable to race conditions. Try run with
go run -race
One example for all:
broadcast type in adapter.go uses unsynchronized access to the map (Join, Leave, Send)
The text was updated successfully, but these errors were encountered: