diff options
author | Philipp Haller <hallerp@gmail.com> | 2010-12-07 11:36:23 +0000 |
---|---|---|
committer | Philipp Haller <hallerp@gmail.com> | 2010-12-07 11:36:23 +0000 |
commit | 0f188e1b47932b05d65d699dba88dd98dd191c17 (patch) | |
tree | c95d5e8e5c3c968bfc52172159c70f0120eb344d /src/actors/scala | |
parent | ef89729e20aee4f5397792425e344339fe1e7094 (diff) | |
download | scala-0f188e1b47932b05d65d699dba88dd98dd191c17.tar.gz scala-0f188e1b47932b05d65d699dba88dd98dd191c17.tar.bz2 scala-0f188e1b47932b05d65d699dba88dd98dd191c17.zip |
Added uniqueness annotations. Review by rytz.
Diffstat (limited to 'src/actors/scala')
-rw-r--r-- | src/actors/scala/actors/CanReply.scala | 10 | ||||
-rw-r--r-- | src/actors/scala/actors/OutputChannel.scala | 8 |
2 files changed, 11 insertions, 7 deletions
diff --git a/src/actors/scala/actors/CanReply.scala b/src/actors/scala/actors/CanReply.scala index eaaaef1a29..6e240e4476 100644 --- a/src/actors/scala/actors/CanReply.scala +++ b/src/actors/scala/actors/CanReply.scala @@ -9,6 +9,8 @@ package scala.actors +import scala.annotation.unique.unique + /** * The <code>CanReply</code> trait defines result-bearing message send operations. * @@ -27,7 +29,7 @@ trait CanReply[-T, +R] { * @param msg the message to be sent * @return the reply */ - def !?(msg: T): R + def !?(msg: T @unique): R /** * Sends <code>msg</code> to this $actor and @@ -39,7 +41,7 @@ trait CanReply[-T, +R] { * @return <code>None</code> in case of timeout, otherwise * <code>Some(x)</code> where <code>x</code> is the reply */ - def !?(msec: Long, msg: T): Option[R] + def !?(msec: Long, msg: T @unique): Option[R] /** * Sends <code>msg</code> to this $actor and @@ -48,7 +50,7 @@ trait CanReply[-T, +R] { * @param msg the message to be sent * @return the future */ - def !!(msg: T): Future[R] + def !!(msg: T @unique): Future[R] /** * Sends <code>msg</code> to this $actor and @@ -61,6 +63,6 @@ trait CanReply[-T, +R] { * @param handler the function to be applied to the response * @return the future */ - def !![P](msg: T, handler: PartialFunction[R, P]): Future[P] + def !![P](msg: T @unique, handler: PartialFunction[R, P]): Future[P] } diff --git a/src/actors/scala/actors/OutputChannel.scala b/src/actors/scala/actors/OutputChannel.scala index c86cfbad32..3a3a1f8384 100644 --- a/src/actors/scala/actors/OutputChannel.scala +++ b/src/actors/scala/actors/OutputChannel.scala @@ -9,6 +9,8 @@ package scala.actors +import scala.annotation.unique.unique + /** * The <code>OutputChannel</code> trait provides a common interface * for all channels to which values can be sent. @@ -24,7 +26,7 @@ trait OutputChannel[-Msg] { * * @param msg the message to send */ - def !(msg: Msg): Unit + def !(msg: Msg @unique): Unit /** * Sends <code>msg</code> to this $actor (asynchronous) supplying @@ -33,14 +35,14 @@ trait OutputChannel[-Msg] { * @param msg the message to send * @param replyTo the reply destination */ - def send(msg: Msg, replyTo: OutputChannel[Any]): Unit + def send(msg: Msg @unique, replyTo: OutputChannel[Any]): Unit /** * Forwards <code>msg</code> to this $actor (asynchronous). * * @param msg the message to forward */ - def forward(msg: Msg): Unit + def forward(msg: Msg @unique): Unit /** * Returns the <code>Actor</code> that is receiving from this $actor. |