diff --git a/akka-docs/scala/code/docs/dataflow/DataflowDocSpec.scala b/akka-docs/scala/code/docs/dataflow/DataflowDocSpec.scala index ab69ed4a00..ae182f447e 100644 --- a/akka-docs/scala/code/docs/dataflow/DataflowDocSpec.scala +++ b/akka-docs/scala/code/docs/dataflow/DataflowDocSpec.scala @@ -6,14 +6,10 @@ package docs.dataflow import language.postfixOps import scala.concurrent.util.duration._ -import scala.concurrent.{ Await, ExecutionContext, Future, Promise } +import scala.concurrent.{ Await, Future, Promise } import org.scalatest.WordSpec import org.scalatest.matchers.MustMatchers -import util.{ Try, Failure, Success } - -object DataflowDocSpec { - -} +import scala.util.{ Try, Failure, Success } class DataflowDocSpec extends WordSpec with MustMatchers { @@ -23,7 +19,7 @@ class DataflowDocSpec extends WordSpec with MustMatchers { //#import-global-implicit import scala.concurrent.ExecutionContext.Implicits.global - //#global-implicit + //#import-global-implicit import DataflowDocSpec._ "demonstrate flow using hello world" in { diff --git a/akka-docs/scala/dataflow.rst b/akka-docs/scala/dataflow.rst index 964daf59db..f39617719e 100644 --- a/akka-docs/scala/dataflow.rst +++ b/akka-docs/scala/dataflow.rst @@ -11,7 +11,7 @@ The benefit of Dataflow concurrency is that it is deterministic; that means that If you run it once and it yields output 5 then it will do that **every time**, run it 10 million times - same result. If it on the other hand deadlocks the first time you run it, then it will deadlock **every single time** you run it. Also, there is **no difference** between sequential code and concurrent code. These properties makes it very easy to reason about concurrency. -The limitation is that the code needs to be side-effect free, e.g. deterministic. +The limitation is that the code needs to be side-effect free, i.e. deterministic. You can't use exceptions, time, random etc., but need to treat the part of your program that uses dataflow concurrency as a pure function with input and output. The best way to learn how to program with dataflow variables is to read the fantastic book `Concepts, Techniques, and Models of Computer Programming `_. By Peter Van Roy and Seif Haridi.