File tree Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Expand file tree Collapse file tree 1 file changed +33
-0
lines changed Original file line number Diff line number Diff line change 1+
2+ import scala .concurrent .duration .FiniteDuration
3+ import scala .concurrent .duration ._
4+
5+ trait Resource [F [_], A ]
6+ trait IO [A ]
7+
8+ trait Cache [F [_], K , V ]
9+
10+ object Cache {
11+
12+ final case class Config (expireAfterRead : FiniteDuration )
13+
14+ def expiring [F [_], K , V ](
15+ expireAfter : FiniteDuration
16+ ): Resource [F , Cache [F , K , V ]] = ???
17+
18+ def expiring [F [_], K , V ](
19+ config : Config ,
20+ partitions : Option [Int ] = None
21+ ): Resource [F , Cache [F , K , V ]] = ???
22+
23+ /* Without partitions being specified, error is yielded */
24+
25+ val notCompiling = expiring[IO , Int , Int ](
26+ config = Config (expireAfterRead = 1 .minute)
27+ )
28+
29+ val compiling = expiring[IO , Int , Int ](
30+ config = Config (expireAfterRead = 1 .minute),
31+ partitions = None
32+ )
33+ }
You can’t perform that action at this time.
0 commit comments