=str #15707 name unnamed modules

* give name attribute to TickSource and nested modules
* reflow module toString output
* give toString to flow
This commit is contained in:
Martynas Mickevičius 2015-11-04 11:43:11 +02:00
parent 3b9b95b0eb
commit ee5ec72552
14 changed files with 48 additions and 36 deletions

View file

@ -106,8 +106,7 @@ class MigrationsScala extends AkkaSpec {
// This finishes the stream without emitting anything, just like Source.lazyEmpty did
promise.trySuccess(Some(()))
// FIXME: After https://github.com/akka/akka/pull/18792 merged
val ticks = Source(1.second, 3.seconds, "tick")
val ticks = Source.tick(1.second, 3.seconds, "tick")
//#source-creators
//#flatMapConcat

View file

@ -77,7 +77,7 @@ class FlowDocSpec extends AkkaSpec {
import scala.concurrent.duration._
case object Tick
val timer = Source(initialDelay = 1.second, interval = 1.seconds, tick = () => Tick)
val timer = Source.tick(initialDelay = 1.second, interval = 1.seconds, tick = () => Tick)
val timerCancel: Cancellable = Sink.ignore.runWith(timer)
timerCancel.cancel()
@ -148,7 +148,7 @@ class FlowDocSpec extends AkkaSpec {
"various ways of transforming materialized values" in {
import scala.concurrent.duration._
val throttler = Flow.fromGraph(FlowGraph.create(Source(1.second, 1.second, "test")) { implicit builder =>
val throttler = Flow.fromGraph(FlowGraph.create(Source.tick(1.second, 1.second, "test")) { implicit builder =>
tickSource =>
import FlowGraph.Implicits._
val zip = builder.add(ZipWith[String, Int, Int](Keep.right))

View file

@ -44,9 +44,9 @@ class StreamBuffersRateSpec extends AkkaSpec {
val zipper = b.add(ZipWith[Tick, Int, Int]((tick, count) => count))
Source(initialDelay = 3.second, interval = 3.second, Tick()) ~> zipper.in0
Source.tick(initialDelay = 3.second, interval = 3.second, Tick()) ~> zipper.in0
Source(initialDelay = 1.second, interval = 1.second, "message!")
Source.tick(initialDelay = 1.second, interval = 1.second, "message!")
.conflate(seed = (_) => 1)((count, _) => count + 1) ~> zipper.in1
zipper.out ~> Sink.foreach(println)

View file

@ -66,7 +66,7 @@ class StreamTestKitDocSpec extends AkkaSpec {
"sink actor ref" in {
//#sink-actorref
case object Tick
val sourceUnderTest = Source(0.seconds, 200.millis, Tick)
val sourceUnderTest = Source.tick(0.seconds, 200.millis, Tick)
val probe = TestProbe()
val cancellable = sourceUnderTest.to(Sink.actorRef(probe.ref, "completed")).run()