No need Mutex if you use Channel. Am I right?
Closed this issue · 4 comments
ianberdin commented
I'm talk about https://github.com/olahol/melody/blob/master/hub.go#L34-L36 and code below
ianberdin commented
Access tot hub.session already synchronous, because channels not buffered.
ianberdin commented
It's code totally synchronous...
https://github.com/olahol/melody/blob/master/examples/gophers/main.go
olahol commented
It's locked because hub.sessions
can be accessed asynchronously by hub.len()
.
https://github.com/olahol/melody/blob/master/hub.go#L71-L76
What's the problem with https://github.com/olahol/melody/blob/master/examples/gophers/main.go ?
ianberdin commented
Understand, thank you