Re-introducing 'sender' and 'senderFuture' references. Now 'sender' is available both for !! and !!! message sends

This commit is contained in:
Jonas Bonér 2010-05-19 10:09:30 +02:00
parent 05058af370
commit 8842362f42
8 changed files with 72 additions and 70 deletions

View file

@ -83,14 +83,8 @@ import se.scalablesolutions.akka.dispatch.CompletableFuture
def receive = {
case Get =>
val ref = dataFlow.value.get
if (ref.isDefined)
self.reply(ref.get)
else {
readerFuture = self.replyTo match {
case Some(Right(future)) => Some(future.asInstanceOf[CompletableFuture[T]])
case _ => None
}
}
if (ref.isDefined) self.reply(ref.get)
else readerFuture = self.senderFuture.asInstanceOf[Option[CompletableFuture[T]]]
case Set(v:T) => if (readerFuture.isDefined) readerFuture.get.completeWithResult(v)
case Exit => exit
}