Skip to content

Latest commit

 

History

History
59 lines (43 loc) · 1.41 KB

README.md

File metadata and controls

59 lines (43 loc) · 1.41 KB

Redis Scala Support to Play! Framework 2.1 Build Status Coverage Status

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.

How to use it

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()

Use it

Configuration

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