Open armanbilge opened 1 month ago
@armanbilge I'd like to pick this up
@BalmungSan raised a good point that this default constructor should only require a Concurrent
constraint. We can pattern-match for Async
to use ConcurrentHashMap
implementation, otherwise maybe we can fallback to the sharded Ref[Map]
with the number of shards determined by the number of processors.
While we're at it, a nicer API for defaultedMapRef
would also be welcome. E.g. a constructor that directly takes a default value, or an instance method on trait MapRef
. MapRefOptionOps
is probably a good place for it too.
MapRefOptionOps
is probably a good place for it too.
Yes, I think this would be my vote. I think should be easy to chain with the constructor as well so we won't need a separate constructor?
We currently have many
MapRef
implementations, based onRef[Map]
, sharding,ConcurrentHashMap
, etc. We should have anapply
constructor that chooses a reasonable default implementation, probablyConcurrentHashMap
.