This is a plugin for Play 2.1, enabling support for Rediscala - A Redis client for Scala (2.10+) and (AKKA 2.2+) with non-blocking and asynchronous I/O operations.
Add the plugin to your dependencies
"fr.njin" %% "play2-rediscala" % "1.0.1"
And declare it in conf/play.plugins
200:play.modules.rediscala.RedisPlugin
Get your client
val client = RedisPlugin.client()(app, Akka.system(app))
or
import play.api.Play.current
implicit val system = Akka.system
val client = RedisPlugin.client()
Rediscala Plugin can handle multiple databases. You can configure them in your app configuration file application.conf
redis {
# The default database.
default {
# You can use uri to configure a database
uri: "redis://user:[email protected]:9092/"
}
mydb {
host: localhost
port: 6379
password: ...
}
...
}
RedisPlugin.client() //Give you the default database client
RedisPlugin.client("mydb") //Give you 'mydb' database client