PK G?g8T8 8 build.xml
PK G??< manifestversion=0.3
frameworkVersions=
PK G?gt- - README.textile*Redis Module for Play Framework*
This plugin allow you to integrate redis with your Play application. It consists of three parts:
1. A redis client used to persist data to a redis instance.
2. A redis implementation of Play's cache interface. This allows you to use redis for your caching needs.
3. A redis cache monitor that helps you debug issues with your redis cache.
With this plugin, you can choose to use redis as a persistent data store or a caching system or both. Note that if you choose both, you'll need separate redis instances. The cache is flushed at application shutdown.
*Installation*
To install the redis module, add this to your conf/dependencies.yml file:
require:
- play -> redis
*Using the Redis Client*
Configuring the redis client is easy. Simply add this property to your conf/application.conf file:
redis.url=redis://username:password@host:port
Within your application code, the redis client is available via the play.modules.redis.Redis class. For example, you can set and get values with the following code:
Redis.set("key", "value");
Redis.get("key");
Note that this class abstracts away the client implementation. If for some reason, you wish to get the native client, that is possible as well:
@RedisConnectionManager.getRawConnection().set("key", "value");@
RedisConnectionManager.getRawConnection will return a "Jedis":https://github.com/xetorthio/jedis client.
*Using the Redis Client with Shared Instances*
The plugin supports sharded instances. Within your conf/application.conf file, specify the connection urls to the various shards:
redis.1.url=redis://username:password@host:port
redis.2.url=redis://...
Now you may use the Redis client the same way as above. If you wish to get a native client, you can with the following:
@RedisConnectionManager.getRawConnectionFromShard("key");@
This will return a Jedis client to the shard containing the key argument.
*Using Redis for Caching*
Again, the configuration is easy. Add these properties to your conf/application.conf file:
redis.cache=enabled
redis.cache.url=redis://username:password@host:port
Now you can use the Cache interface like you normally would in your Play application:
@Cache.set("key", "value", "30s");@
*Using the Redis Cache Monitor*
This monitor helps debug your cache while your Play app is running. Simply add this to your routes file:
* /cache module:redis
Now you can drop the cacheMonitor tag in any of your views:
@#{cacheMonitor /}@
The cache monitor will report your cache contents as well as information about your cache redis instance.
*Source Code*
The source code is available on Github at https://github.com/tkral/play-redis
*Change Log*
v0.3:
* Add caching support for model objects
PK G?8>D D lib/stringtemplate-3.2.1.jarPK
{6; META-INF/PK
{6;xwe { META-INF/MANIFEST.MFMLK-.
K-*ϳR03r,J,K-BV+$xRKRSt*3R|RxJ3sJY~WJ6p3=xC3^.^. PK
{6; org/PK
{6;
org/antlr/PK
{6; org/antlr/stringtemplate/PK
{6; org/antlr/stringtemplate/misc/PK
{6; " org/antlr/stringtemplate/language/PK
{6;){ : org/antlr/stringtemplate/StringTemplateErrorListener.class}A8N+QXj*.%sd,n
-
1$|/W tBCDB
;}hIn[)J6Wb+F'<7L)F;E~tlY>N)mu|-?YBS\xB
~j v͊T{PK
{6;K1BA5 v - org/antlr/stringtemplate/StringTemplate.class| |TedH$H&,dLH&,"*
}"- 0.Z{]vSkնֶjw}o,`h_r߽{{ιwx?O> _9Atِ|t7B'^6Et.eK
etJmt.?4Jwtw_MZs]
t.7fB[iimt;v':;N0M-^q=Opp0\Sw;?F_K:G-O8~?
xft9Dt9O:y?E'Ths:*BT./:K:eBWk:o:S?'o9:G/u5.JAz-]>t/O_>gt>.t?Q/t%s\up5p 7o?:?p8w ;.I/:]RRS:DCBGrAʸLY".}?PwPFcRҟ^sb !1tD9jK1 Ua)t1\yN1BS«S /"F9h'F3t1PbJdb.E.&Q3Xuq.]LE}t1]3t1B]ct1^9D>G;st1>:EtQys P
],"XL*D.tɰR Af<_˨q.Vb.Xj]Ps.Qhp^b5$T$t k3]/[tJ6bab:Hl kH_M{wRu];Y -.I[ĥ|Cl6z>ߥP+\0%niX6%`eZ5 eJ]]K0p,QQY2td?X7&1H
"c[@W"p%J0`%2~Q6u3S3i>A͂AyUeV\|JzcC0\A-@K XcnhI3DB qfBmp3R2Q"P+έDN(
ԍ)6lذzE,-umM`l@!ߌ}H)Ȝ3On%a6o7@lkt@iUe^@1&ņcQ[BmuL
C3BGj90Mg64R@?0gZJq(B."AhF-PBADHCklAxxUH{mTr\Ixn=I.l1jc`wjڗE3HҎ