scala-redis
scala-redis copied to clipboard
Concurrency problems when updating Redis
When using the client in a multi-threaded execution context, the cache gets updated with overlapped values as in
<value String> $3 SET $6
<value String>. Running the Redis operations in a single threaded execution context. Race condition on its own variables. should be fixed by the library.
To use in multithreaded context you need to use pooled connections, as Redis is single threaded. You can take a look at https://github.com/debasishg/scala-redis/blob/master/src/test/scala/com/redis/PoolSpec.scala