Is the hub mutex really needed?
elimist opened this issue · 2 comments
elimist commented
Hey, thanks for making this library, it's great!
I was wondering: is the mutex here really necessary? It seems the sessions map will never be written to by more than one goroutine and there would probably be some perf gains by removing the lock.
olahol commented
It wasn't needed before the hub.len()
method which can read sessions
asynchronously. It is probably possible to rewrite it without using locks though.
I answered this before:
elimist commented
Sorry, I missed that issue. That clears it up, thanks!