Sedis for Scala 2.11.1

a thin scala wrapper for jedis

License

License

MIT
GroupId

GroupId

org.sedis
ArtifactId

ArtifactId

sedis_2.11
Last Version

Last Version

1.2.2
Release Date

Release Date

Type

Type

jar
Description

Description

Sedis for Scala 2.11.1
a thin scala wrapper for jedis
Project URL

Project URL

https://github.com/pk11/sedis
Source Code Management

Source Code Management

https://github.com/pk11/sedis

Download sedis_2.11

How to add to project

<!-- https://jarcasting.com/artifacts/org.sedis/sedis_2.11/ -->
<dependency>
    <groupId>org.sedis</groupId>
    <artifactId>sedis_2.11</artifactId>
    <version>1.2.2</version>
</dependency>
// https://jarcasting.com/artifacts/org.sedis/sedis_2.11/
implementation 'org.sedis:sedis_2.11:1.2.2'
// https://jarcasting.com/artifacts/org.sedis/sedis_2.11/
implementation ("org.sedis:sedis_2.11:1.2.2")
'org.sedis:sedis_2.11:jar:1.2.2'
<dependency org="org.sedis" name="sedis_2.11" rev="1.2.2">
  <artifact name="sedis_2.11" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.sedis', module='sedis_2.11', version='1.2.2')
)
libraryDependencies += "org.sedis" % "sedis_2.11" % "1.2.2"
[org.sedis/sedis_2.11 "1.2.2"]

Dependencies

compile (1)

Group / Artifact Type Version
redis.clients : jedis jar 2.4.2

test (1)

Group / Artifact Type Version
org.scalatest : scalatest_2.11 jar 2.2.0

Project Modules

There are no modules declared in this project.

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

Versions

Version
1.2.2