olahol/melody

Is the hub mutex really needed?

elimist opened this issue · 2 comments

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.

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:

#20

Sorry, I missed that issue. That clears it up, thanks!