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 further information on changing the behavior of an actor after its
construction. 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
`Props` is a configuration class to specify options for the creation `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 #### Dangerous Variants
@@snip [ActorDocSpec.scala]($code$/scala/docs/actor/ActorDocSpec.scala) { #creating-props-deprecated } @@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 Akka Streams in order to tell you how many bytes or elements were consumed and
whether the stream terminated normally or exceptionally. 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 ## Reusable Pieces
One of the nice parts of Akka Streams—and something that other stream libraries 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 ## Broadcasting a stream
Now let's say we want to persist all hashtags, as well as all author names from this one live 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 import jdocs.actor.ImmutableMessage
//#fiddle_code
import language.postfixOps import language.postfixOps
//#fiddle_code
//#fiddle_code
//#imports1 //#imports1
import akka.actor.Actor import akka.actor.Actor
import akka.actor.Props import akka.actor.Props
//#fiddle_code
import akka.event.Logging import akka.event.Logging
//#imports1 //#imports1
import scala.concurrent.Future import scala.concurrent.Future
//#fiddle_code
import akka.actor.{ ActorRef, ActorSystem, PoisonPill, Terminated, ActorLogging } import akka.actor.{ ActorRef, ActorSystem, PoisonPill, Terminated, ActorLogging }
//#fiddle_code
import org.scalatest.{ BeforeAndAfterAll, WordSpec } import org.scalatest.{ BeforeAndAfterAll, WordSpec }
import akka.testkit._ import akka.testkit._
import akka.util._ import akka.util._
//#fiddle_code
import scala.concurrent.duration._ import scala.concurrent.duration._
//#fiddle_code
import scala.concurrent.Await import scala.concurrent.Await
import akka.Done import akka.Done
import akka.actor.CoordinatedShutdown import akka.actor.CoordinatedShutdown
@ -284,6 +276,9 @@ final case class Give(thing: Any)
//#receive-orElse //#receive-orElse
//#fiddle_code //#fiddle_code
import akka.actor.{ ActorSystem, Actor, ActorRef, Props, PoisonPill }
import language.postfixOps
import scala.concurrent.duration._
case object Ping case object Ping
case object Pong case object Pong

View file

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