Skip to content
a thin scala wrapper for jedis (https://github.com/xetorthio/jedis)
Scala
Latest commit b26ff44 May 24, 2016 @pk11 Merge pull request #20 from graingert/fix-packaging
configure sbt
Failed to load latest commit information.
project use sbt May 15, 2016
src Merge pull request #17 from divarvel/issues/15 May 22, 2016
.gitignore
LICENSE.md
README.md Update README.md Jul 15, 2014
build.sbt
pom.xml use sbt May 15, 2016
pom2.10.xml publish 1.2.2 version for 2.10 and 2.11. Also drop 2.9 Jul 15, 2014
version.sbt

README.md

Sedis

Sedis is a thin wrapper around Jedis, the most commonly-used Redis library on the JVM.

Requirements

  • Scala 2.11 or 2.10
  • Jedis 2.4.2

Getting Started

First, specify Sedis as a dependency:

<repositories>
    <repository>
        <id>org.sedis</id>
        <url>http://pk11-scratch.googlecode.com/svn/trunk</url>
    </repository>
</repositories>

<dependencies>
    <dependency>
        <groupId>org.sedis</groupId>
        <artifactId>sedis_${scala.version}</artifactId>
        <version>1.2.2</version>
    </dependency>
</dependencies>

Second, start using it right away:

 import org.sedis._
 import redis.clients.jedis._
 val pool = new Pool(new JedisPool(new JedisPoolConfig(), "localhost", 6379, 2000))

 pool.withJedisClient { client =>· 
   Dress.up(client).get("single").isDefined.must(be(true))
   Dress.up(client).get("single").get.must(be("foo"))
   val r: List[String] = Dress.up(client).lrange("test",0,2)·
   r.size.must(be(2))
   r.toString.must(be("List(bar, foo)"))
   val s: List[String] = Dress.up(client).sort("test")
   s.size.must(be(2))
   s.toString.must(be("List(bar, foo)"))
}   

//or using implicits

import Dress._
pool.withClient { client => 
  client.get("single").isDefined.must(be(true))
  client.get("single").get.must(be("foo"))
  client.lindex("test",0).must(be("bar"))
  val r: List[String] = client.lrange("test",0,2)
  r.size.must(be(2))
  r.toString.must(be("List(bar, foo)"))
  val s: List[String] = client.sort("test")
  s.size.must(be(2))
  s.toString.must(be("List(bar, foo)"))
}

you can find all the different enhancement methods here

License

Published under The MIT License, see LICENSE

Something went wrong with that request. Please try again.