From b9832cf279484e7a494a3806578171e793c1c8a0 Mon Sep 17 00:00:00 2001 From: Derek Williams Date: Thu, 2 Jun 2011 08:19:47 -0600 Subject: [PATCH] Change from @suspendable to @cps[Any] to avoid silly type errors --- akka-actor/src/main/scala/akka/actor/IO.scala | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/akka-actor/src/main/scala/akka/actor/IO.scala b/akka-actor/src/main/scala/akka/actor/IO.scala index 5cfb1dead7..b693b8be3e 100644 --- a/akka-actor/src/main/scala/akka/actor/IO.scala +++ b/akka-actor/src/main/scala/akka/actor/IO.scala @@ -77,7 +77,7 @@ trait IO { handle } - def accept(source: IO.Handle): Unit = accept(source, self) + def accept(source: IO.Handle): IO.Handle = accept(source, self) def write(handle: IO.Handle, bytes: ByteString): Unit = handle.ioManager ! IO.Write(handle, bytes) @@ -92,10 +92,10 @@ object IOActor { def this() = this(mutable.Queue.empty, ByteRope.empty, false) } - sealed trait IOContinuation[A] { def continuation: (A) ⇒ Unit } - case class ByteStringLength(continuation: (ByteString) ⇒ Unit, length: Int) extends IOContinuation[ByteString] - case class ByteStringDelimited(continuation: (ByteString) ⇒ Unit, delimter: ByteString, inclusive: Boolean, scanned: Int) extends IOContinuation[ByteString] - case class ByteStringAny(continuation: (ByteString) ⇒ Unit) extends IOContinuation[ByteString] + sealed trait IOContinuation[A] { def continuation: (A) ⇒ Any } + case class ByteStringLength(continuation: (ByteString) ⇒ Any, length: Int) extends IOContinuation[ByteString] + case class ByteStringDelimited(continuation: (ByteString) ⇒ Any, delimter: ByteString, inclusive: Boolean, scanned: Int) extends IOContinuation[ByteString] + case class ByteStringAny(continuation: (ByteString) ⇒ Any) extends IOContinuation[ByteString] } trait IOActor extends Actor with IO { @@ -119,19 +119,19 @@ trait IOActor extends Actor with IO { s } - protected def read(handle: IO.Handle, len: Int): ByteString @suspendable = shift { cont: (ByteString ⇒ Unit) ⇒ + protected def read(handle: IO.Handle, len: Int): ByteString @cps[Any] = shift { cont: (ByteString ⇒ Any) ⇒ state(handle).messages enqueue self.currentMessage _continuations += (self.currentMessage -> ByteStringLength(cont, len)) run(handle) } - protected def read(handle: IO.Handle): ByteString @suspendable = shift { cont: (ByteString ⇒ Unit) ⇒ + protected def read(handle: IO.Handle): ByteString @cps[Any] = shift { cont: (ByteString ⇒ Any) ⇒ state(handle).messages enqueue self.currentMessage _continuations += (self.currentMessage -> ByteStringAny(cont)) run(handle) } - protected def read(handle: IO.Handle, delimiter: ByteString, inclusive: Boolean = false): ByteString @suspendable = shift { cont: (ByteString ⇒ Unit) ⇒ + protected def read(handle: IO.Handle, delimiter: ByteString, inclusive: Boolean = false): ByteString @cps[Any] = shift { cont: (ByteString ⇒ Any) ⇒ state(handle).messages enqueue self.currentMessage _continuations += (self.currentMessage -> ByteStringDelimited(cont, delimiter, inclusive, 0)) run(handle) @@ -154,7 +154,7 @@ trait IOActor extends Actor with IO { () } - def receiveIO: PartialFunction[Any, Unit @suspendable] + def receiveIO: PartialFunction[Any, Any @cps[Any]] private lazy val _receiveIO = receiveIO