semian
semian copied to clipboard
Thread Safety
Hi,
I've noticed Semian has a few globals that aren't thread safe, or at least they're shared among threads. For example this consumers instance variable, the LRU cache, and this subscribers instance variable are all globals. I don't think they should be shared among threads, and if they are, I think they should be using a concurrent hash map.
I don't know all of the possible usages for this library, so I'm not sure the best way to fix it, but I don't think it's correct as it stands.
Thanks!