File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,9 @@ the pairs can be sharded by key.
2727Thus, multiple concurrent updates may be executed independently to each other,
2828as long as their keys belong to different shards.
2929
30+ Since ` MapRef ` is a total map, constructors of ` MapRef ` either take a default
31+ value or return a ` MapRef[F, K, Option[V]] ` .
32+
3033### In-Memory database
3134
3235This is probably one of the most common uses of this datatype.
@@ -46,7 +49,7 @@ object DatabaseClient {
4649 def inMemory [Id , Data ]: IO [DatabaseClient [IO , Id , Data ]] =
4750 MapRef .ofShardedImmutableMap[IO , Id , Data ](
4851 shardCount = 5 // Arbitrary number of shards just for demonstration.
49- ).map { mapRef =>
52+ ).map { ( mapRef : MapRef [ IO , Id , Option [ Data ]]) =>
5053 new DatabaseClient [IO , Id , Data ] {
5154 override def getDataById (id : Id ): IO [Option [Data ]] =
5255 mapRef(id).get
You can’t perform that action at this time.
0 commit comments