Skip to content

0xRoch/play2-rediscala

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.0"

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
		user: ...
		password: ...
	}
	...
}
RedisPlugin.client() //Give you the default database client
RedisPlugin.client("mydb") //Give you 'mydb' database client

Please Notice

Authentication is not handle by the plugin (yet?) so user and password key are useless for now

About

Rediscala Play framework 2 plugin

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published