All I wish is to use some parallel Set (which does not exist at all). Java uses java.util.concurrent.ConcurrentHashMap<K, Void> to achieve this behavior. I would like to make sth similar in Scala, so I created an instance of Scala HashMap (or Java ConcurrentHashMap) and tried to add some tuples:
val myMap = new HashMap[String, Unit]() myMap + (("myStringKey", Unit))
This, of course, broke the compilation process, as the Unit is abstract and final.
How to make this work? Should I use Any / AnyRef instead? I have to ensure that no one inserts any value.
thanks for the help
source share