From f21a83ec3c7de8e32cc20ce4c34828d8a87a7bb4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20Bon=C3=A9r?= Date: Wed, 24 Nov 2010 14:49:10 +0100 Subject: [PATCH] added effect to java api --- .../src/main/scala/akka/dataflow/DataFlowVariable.scala | 6 +++--- akka-actor/src/main/scala/akka/japi/JavaAPI.scala | 7 +++++++ 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/akka-actor/src/main/scala/akka/dataflow/DataFlowVariable.scala b/akka-actor/src/main/scala/akka/dataflow/DataFlowVariable.scala index 5b72503c43..9becd42e48 100644 --- a/akka-actor/src/main/scala/akka/dataflow/DataFlowVariable.scala +++ b/akka-actor/src/main/scala/akka/dataflow/DataFlowVariable.scala @@ -11,7 +11,7 @@ import akka.actor.{Actor, ActorRef} import akka.actor.Actor._ import akka.dispatch.CompletableFuture import akka.AkkaException -import akka.japi.{ Function, SideEffect } +import akka.japi.{ Function, Effect } /** * Implements Oz-style dataflow (single assignment) variables. @@ -28,10 +28,10 @@ object DataFlow { */ def thread(body: => Unit): Unit = spawn(body) - /** Executes the supplied SideEffect in another thread + /** Executes the supplied Effect in another thread * JavaAPI */ - def thread(body: SideEffect): Unit = spawn(body.apply) + def thread(body: Effect): Unit = spawn(body.apply) /** Executes the supplied function in another thread */ diff --git a/akka-actor/src/main/scala/akka/japi/JavaAPI.scala b/akka-actor/src/main/scala/akka/japi/JavaAPI.scala index 88732a4efc..4454ed117a 100644 --- a/akka-actor/src/main/scala/akka/japi/JavaAPI.scala +++ b/akka-actor/src/main/scala/akka/japi/JavaAPI.scala @@ -20,6 +20,13 @@ trait SideEffect { def apply: Unit } +/** + * An executable piece of code that takes no parameters and doesn't return any value. + */ +trait Effect { + def apply: Unit +} + /** + * A constructor/factory, takes no parameters but creates a new value of type T every call + */