addressing comments

This commit is contained in:
andrea 2017-05-22 14:40:15 +01:00 committed by Konrad `ktoso` Malawski
parent 8a6cebedef
commit 833f3e8f32
4 changed files with 20 additions and 23 deletions

View file

@ -51,6 +51,12 @@ stored within the actor as its “initial behavior”, see [Become/Unbecome](#be
further information on changing the behavior of an actor after its
construction.
#### Here is another example that you can edit and run in the browser:
@@fiddle [ActorDocSpec.scala]($code$/scala/docs/actor/ActorDocSpec.scala) { #fiddle_code height=400px extraParams=theme=light&layout=v75 cssStyle=width:100%; }
### Props
`Props` is a configuration class to specify options for the creation
@ -78,12 +84,6 @@ for cases when the actor constructor takes value classes as arguments.
@@@
@@@ note { title=DIY }
@@fiddle [ActorDocSpec.scala]($code$/scala/docs/actor/ActorDocSpec.scala) { #fiddle_code height=400px extraParams=theme=light&layout=v75 cssStyle=width:100%; }
@@@
#### Dangerous Variants
@@snip [ActorDocSpec.scala]($code$/scala/docs/actor/ActorDocSpec.scala) { #creating-props-deprecated }

View file

@ -82,6 +82,12 @@ called a `Sink`. `IOResult` is a type that IO operations return in
Akka Streams in order to tell you how many bytes or elements were consumed and
whether the stream terminated normally or exceptionally.
#### Here is another example that you can edit and run in the browser:
@@fiddle [TwitterStreamQuickstartDocSpec.scala]($code$/scala/docs/stream/TwitterStreamQuickstartDocSpec.scala) { #fiddle_code height=400px extraParams=theme=light&layout=v75 cssStyle=width:100%; }
## Reusable Pieces
One of the nice parts of Akka Streams—and something that other stream libraries
@ -241,12 +247,6 @@ whereas `flatMap` would have to operate on streams all the way through.
@@@
@@@ note { title=DIY }
@@fiddle [TwitterStreamQuickstartDocSpec.scala]($code$/scala/docs/stream/TwitterStreamQuickstartDocSpec.scala) { #fiddle_code height=400px extraParams=theme=light&layout=v75 cssStyle=width:100%; }
@@@
## Broadcasting a stream
Now let's say we want to persist all hashtags, as well as all author names from this one live stream.

View file

@ -5,29 +5,21 @@ package docs.actor
import jdocs.actor.ImmutableMessage
//#fiddle_code
import language.postfixOps
//#fiddle_code
//#fiddle_code
//#imports1
import akka.actor.Actor
import akka.actor.Props
//#fiddle_code
import akka.event.Logging
//#imports1
import scala.concurrent.Future
//#fiddle_code
import akka.actor.{ ActorRef, ActorSystem, PoisonPill, Terminated, ActorLogging }
//#fiddle_code
import org.scalatest.{ BeforeAndAfterAll, WordSpec }
import akka.testkit._
import akka.util._
//#fiddle_code
import scala.concurrent.duration._
//#fiddle_code
import scala.concurrent.Await
import akka.Done
import akka.actor.CoordinatedShutdown
@ -284,6 +276,9 @@ final case class Give(thing: Any)
//#receive-orElse
//#fiddle_code
import akka.actor.{ ActorSystem, Actor, ActorRef, Props, PoisonPill }
import language.postfixOps
import scala.concurrent.duration._
case object Ping
case object Pong
@ -380,7 +375,7 @@ class ActorDocSpec extends AkkaSpec("""
ponger ! Ping
}
// $FiddleDependency org.akka-js %%% akkajsactor % 1.2.5.1
// $FiddleDependency org.akka-js %%% akkajsactor % 1.2.5.1
//#fiddle_code
testProbe.expectTerminated(pinger)
testProbe.expectTerminated(ponger)

View file

@ -5,12 +5,10 @@ package docs.stream
//#imports
//#fiddle_code
import akka.{ Done, NotUsed }
import akka.actor.ActorSystem
import akka.stream.{ ClosedShape, ActorMaterializer, OverflowStrategy }
import akka.stream.scaladsl._
//#fiddle_code
import scala.concurrent.Await
import scala.concurrent.Future
@ -20,6 +18,10 @@ import akka.testkit.AkkaSpec
object TwitterStreamQuickstartDocSpec {
//#fiddle_code
import akka.NotUsed
import akka.actor.ActorSystem
import akka.stream.ActorMaterializer
import akka.stream.scaladsl._
//#model
final case class Author(handle: String)