Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
base fork: jamesgolick/smemcache
base: master
...
head fork: a5an0/smemcache
compare: master
Checking mergeability… Don't worry, you can still create the pull request.
  • 3 commits
  • 2 files changed
  • 0 commit comments
  • 1 contributor
Showing with 12 additions and 3 deletions.
  1. +2 −1  project/build/Smemcache.scala
  2. +10 −2 src/main/scala/Memcache.scala
View
3  project/build/Smemcache.scala
@@ -3,9 +3,10 @@ import sbt._
class SmemcacheProject(info: ProjectInfo) extends DefaultProject(info) {
val codaRepo = "Coda Hale's Repository" at "http://repo.codahale.com/"
val specsRepo = "Specs Repo" at "http://nexus.scala-tools.org/content/repositories/snapshots"
+ val spyRepo = "Spy Repo" at "http://files.couchbase.com/maven2/"
val specs = "org.scala-tools.testing" % "specs_2.8.0" % "1.6.5"
val mockito = "org.mockito" % "mockito-all" % "1.8.5"
- val spymemcached = "net.spy.memcached" % "spymemcached" % "2.4.2" from "http://spymemcached.googlecode.com/files/memcached-2.4.2.jar"
+ val spymemcached = "net.spy.memcached" % "spymemcached" % "2.6"
val snapshotsRepo = "Scala Tools Snapshots Repository" at "http://scala-tools.org/repo-snapshots/"
val logula = "com.codahale" %% "logula" % "1.0.3" withSources()
}
View
12 src/main/scala/Memcache.scala
@@ -13,8 +13,8 @@ object Memcache {
InetSocketAddress = {
val split = string.split(":")
split.length match {
- case 1 => new InetSocketAddress(split.first, 11211)
- case 2 => new InetSocketAddress(split.first, split.last.toInt)
+ case 1 => new InetSocketAddress(split.head, 11211)
+ case 2 => new InetSocketAddress(split.head, split.last.toInt)
}
}
@@ -72,4 +72,12 @@ class Memcache(val client: MemcachedClient) {
def add[A](key: String, value: A, expiration: Int = 0): Future[JBool] = {
client.add(key, expiration, value.asInstanceOf[Object])
}
+
+ def incr(key: String, by: Int = 1): Long = {
+ client.incr(key, by)
+ }
+
+ def decr(key: String, by: Int = 1): Long = {
+ client.decr(key, by)
+ }
}

No commit comments for this range

Something went wrong with that request. Please try again.