Skip to content

Commit

Permalink
Scalariform formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
derekjw committed Jan 24, 2012
1 parent 6769624 commit 84040ea
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 24 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/net/fyrie/redis/actors/Actors.scala
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ private[redis] final class RedisClientSession(host: String, port: Int, config: R

case ResultCallback(callback)
resultCallbacks +:= callback
/*
/*
case IO.Closed(handle, Some(cause: ConnectException)) if socket == handle && config.autoReconnect ⇒
log info ("Connection refused, retrying in 1 second")
context.system.scheduler.scheduleOnce(1 second, self, IO.Closed(handle, None))
Expand All @@ -102,7 +102,7 @@ private[redis] final class RedisClientSession(host: String, port: Int, config: R
state(handle)(IO EOF cause)

case Received
//waiting.dequeue
//waiting.dequeue

}

Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/net/fyrie/redis/package.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package net.fyrie

import akka.util.{ByteString, Duration}
import akka.util.{ ByteString, Duration }
import akka.dispatch.{ Future, Promise }
import redis.serialization.Parse

Expand Down
8 changes: 4 additions & 4 deletions src/main/scala/net/fyrie/redis/protocol/Iteratees.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ private[redis] object Iteratees {

final val readResult: IO.Iteratee[RedisType] = IO take 1 flatMap readType

final val bytesToString = (bytes: ByteString) => RedisString(bytes.utf8String)
final val bytesToString = (bytes: ByteString) RedisString(bytes.utf8String)
final val readString: IO.Iteratee[RedisString] = readUntilEOL map bytesToString

final val bytesToError = (bytes: ByteString) => RedisError(bytes.utf8String)
final val bytesToError = (bytes: ByteString) RedisError(bytes.utf8String)
final val readError: IO.Iteratee[RedisError] = readUntilEOL map bytesToError

final val bytesToInteger = (bytes: ByteString) => RedisInteger(bytes.utf8String.toLong)
final val bytesToInteger = (bytes: ByteString) RedisInteger(bytes.utf8String.toLong)
final val readInteger: IO.Iteratee[RedisInteger] = readUntilEOL map bytesToInteger

final val notFoundBulk = IO Done RedisBulk.notfound
Expand All @@ -41,7 +41,7 @@ private[redis] object Iteratees {

final val notFoundMulti = IO Done RedisMulti.notfound
final val emptyMulti = IO Done RedisMulti.empty
final val bytesToMulti = (bytes: ByteString) => bytes.utf8String.toInt match {
final val bytesToMulti = (bytes: ByteString) bytes.utf8String.toInt match {
case -1 notFoundMulti
case 0 emptyMulti
case n IO.takeList(n)(readResult) map (x RedisMulti(Some(x)))
Expand Down
20 changes: 10 additions & 10 deletions src/test/scala/net/fyrie/redis/DBSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,8 @@ class KeysSpec extends mutable.Specification with TestClient {
} yield (x, y)
}
for {
a <- result._1 recover { case _: RedisErrorException => success }
b <- result._2
a result._1 recover { case _: RedisErrorException success }
b result._2
} yield {
b === Some("abc")
}
Expand All @@ -165,8 +165,8 @@ class KeysSpec extends mutable.Specification with TestClient {
} yield (x, y)
}
for {
a <- result._1 recover { case _: RedisErrorException => success }
b <- result._2
a result._1 recover { case _: RedisErrorException success }
b result._2
} yield {
b === List(Some("testvalue1"), Some("testvalue2"))
}
Expand All @@ -176,10 +176,10 @@ class KeysSpec extends mutable.Specification with TestClient {

"watch" >> {
"should fail without watch" ! client { r
r.set("key", 0) flatMap { _ =>
r.set("key", 0) flatMap { _
val clients = List.fill(10)(RedisClient())
val futures = for (client clients; _ 1 to 10) yield client.get("key").parse[Int] flatMap { n client.set("key", n.get + 1) }
Future sequence futures flatMap { _ =>
Future sequence futures flatMap { _
clients foreach (_.disconnect)
r.get("key").parse[Int] map (_ must_!= Some(100))
}
Expand All @@ -195,7 +195,7 @@ class KeysSpec extends mutable.Specification with TestClient {
} yield rw multi (_.set("key", n + 1))
}
}
Future sequence futures flatMap { _ =>
Future sequence futures flatMap { _
r.get("key").parse[Int] map (_ === Some(100))
}
}
Expand All @@ -219,9 +219,9 @@ class KeysSpec extends mutable.Specification with TestClient {
}
}
for {
a <- result
b <- r.lrange("mykey1").parse[Int]
c <- r.hget("mykey3", "hello").parse[Int]
a result
b r.lrange("mykey1").parse[Int]
c r.hget("mykey3", "hello").parse[Int]
} yield {
a === (5, "hello", 7)
b === Some(List(5, 6))
Expand Down
12 changes: 6 additions & 6 deletions src/test/scala/net/fyrie/redis/StringSpec.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ class StringSpec extends mutable.Specification with TestClient {
"set" >> {
"should set key/value pairs" ! client { r
for {
a <- r.set("anshin-1", "debasish")
b <- r.set("anshin-2", "maulindu")
a r.set("anshin-1", "debasish")
b r.set("anshin-2", "maulindu")
} yield {
a === ()
b === ()
Expand All @@ -29,10 +29,10 @@ class StringSpec extends mutable.Specification with TestClient {
"getset" >> {
"should set new values and return old values" ! client { r
for {
_ <- r.set("anshin-1", "debasish")
a <- r.get("anshin-1").parse[String]
b <- r.getset("anshin-1", "maulindu").parse[String]
c <- r.get("anshin-1").parse[String]
_ r.set("anshin-1", "debasish")
a r.get("anshin-1").parse[String]
b r.getset("anshin-1", "maulindu").parse[String]
c r.get("anshin-1").parse[String]
} yield {
a === Some("debasish")
b === Some("debasish")
Expand Down
2 changes: 1 addition & 1 deletion src/test/scala/net/fyrie/redis/TestServer.scala
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ object TestSystem {

trait TestClient { self: mutable.Specification

implicit def futureResult[T](future: Future[T])(implicit toResult: T => Result): Result =
implicit def futureResult[T](future: Future[T])(implicit toResult: T Result): Result =
Await.result(future map toResult, akka.util.Timeout(1000).duration) //Duration.Inf)

implicit val system = TestSystem.system
Expand Down

0 comments on commit 84040ea

Please sign in to comment.