@@ -21,7 +21,7 @@ import scalacache.memcached._
21
21
import scalacache .serialization .binary ._
22
22
import cats .effect .IO
23
23
24
- implicit val memcachedCache : Cache [IO , String ] = MemcachedCache (" localhost:11211" )
24
+ implicit val memcachedCache : Cache [IO , String , String ] = MemcachedCache (" localhost:11211" )
25
25
```
26
26
27
27
or provide your own Memcached client, like this:
@@ -36,7 +36,7 @@ val memcachedClient = new MemcachedClient(
36
36
new BinaryConnectionFactory (),
37
37
AddrUtil .getAddresses(" localhost:11211" )
38
38
)
39
- implicit val customisedMemcachedCache : Cache [IO , String ] = MemcachedCache (memcachedClient)
39
+ implicit val customisedMemcachedCache : Cache [IO , String , String ] = MemcachedCache (memcachedClient)
40
40
```
41
41
42
42
#### Keys
@@ -65,7 +65,7 @@ import scalacache.redis._
65
65
import scalacache .serialization .binary ._
66
66
import cats .effect .IO
67
67
68
- implicit val redisCache : Cache [IO , String ] = RedisCache (" host1" , 6379 )
68
+ implicit val redisCache : Cache [IO , String , String ] = RedisCache (" host1" , 6379 )
69
69
```
70
70
71
71
or provide your own [ Jedis] ( https://github.com/xetorthio/jedis ) client, like this:
@@ -78,7 +78,7 @@ import _root_.redis.clients.jedis._
78
78
import cats .effect .IO
79
79
80
80
val jedisPool = new JedisPool (" localhost" , 6379 )
81
- implicit val customisedRedisCache : Cache [IO , String ] = RedisCache (jedisPool)
81
+ implicit val customisedRedisCache : Cache [IO , String , String ] = RedisCache (jedisPool)
82
82
```
83
83
84
84
ScalaCache also supports [ sharded Redis] ( https://github.com/xetorthio/jedis/wiki/AdvancedUsage#shardedjedis ) and [ Redis Sentinel] ( http://redis.io/topics/sentinel ) . Just create a ` ShardedRedisCache ` or ` SentinelRedisCache ` respectively.
@@ -101,7 +101,7 @@ import cats.effect.unsafe.implicits.global
101
101
102
102
implicit val clock : Clock [IO ] = Clock [IO ]
103
103
104
- implicit val caffeineCache : Cache [IO , String ] = CaffeineCache [IO , String ].unsafeRunSync()
104
+ implicit val caffeineCache : Cache [IO , String , String ] = CaffeineCache [IO , String , String ].unsafeRunSync()
105
105
```
106
106
107
107
This will build a Caffeine cache with all the default settings. If you want to customize your Caffeine cache, then build it yourself and pass it to ` CaffeineCache ` like this:
@@ -114,7 +114,7 @@ import cats.effect.IO
114
114
import cats .effect .unsafe .implicits .global
115
115
116
116
val underlyingCaffeineCache = Caffeine .newBuilder().maximumSize(10000L ).build[String , Entry [String ]]
117
- implicit val customisedCaffeineCache : Cache [IO , String ] = CaffeineCache (underlyingCaffeineCache)
117
+ implicit val customisedCaffeineCache : Cache [IO , String , String ] = CaffeineCache (underlyingCaffeineCache)
118
118
```
119
119
120
120
``` scala mdoc:invisible
0 commit comments