Skip to content

Instantly share code, notes, and snippets.

@czarneckid
Created March 13, 2011 01:15
Show Gist options
  • Save czarneckid/867765 to your computer and use it in GitHub Desktop.
Save czarneckid/867765 to your computer and use it in GitHub Desktop.
Welcome to Scala version 2.8.1.final (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_24).
Type in expressions to have them evaluated.
Type :help for more information.
scala> import com.redis._
import com.redis._
scala> val r = new RedisClient("localhost", 6379)
r: com.redis.RedisClient = localhost:6379
scala> r.set("key", "some value\r\nmore stuff")
res0: Boolean = true
scala> r.get("key")
res1: Option[String] =
Some(some value
more stuff)
scala> val item = "some value\r\nmore stuff"
item: java.lang.String =
some value
more stuff
scala> r.set("key", item)
res21: Boolean = true
scala> val retrieved_item = r.get("key").get
retrieved_item: String =
some value
more stuff
scala> retrieved_item == item
res22: Boolean = true
scala>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment