started processing Hello on thread main A finished processing Hello A started processing Streams on thread main A finished processing Streams A started processing World! on thread main A finished processing World! B started processing Hello on thread main B finished processing Hello B started processing Streams on thread main B finished processing Streams B started processing World! on thread main B finished processing World! C started processing Hello on thread main C finished processing Hello C started processing Streams on thread main C finished processing Streams C started processing World! on thread main C finished processing World! Got output Hello Got output Streams Got output World!
started processing Hello on thread main A finished processing Hello A started processing Streams on thread main A finished processing Streams A started processing World! on thread main A finished processing World! B started processing Hello on thread main B finished processing Hello B started processing Streams on thread main B finished processing Streams B started processing World! on thread main B finished processing World! C started processing Hello on thread main C finished processing Hello C started processing Streams on thread main C finished processing Streams C started processing World! on thread main C finished processing World! Got output Hello Got output Streams Got output World! A B C Hello Streams World! List("Hello", "Streams", "World!") .map(s => processingStageNormal("A", s)) .map(s => processingStageNormal("B", s)) .map(s => processingStageNormal("C", s)) .foreach(s ⇒ println("Got output " + s)) 処理がすべて終わってから 次の処理に進んでいる Hello Streams World! Hello
started processing Hello on thread twitter-convert-akka.actor.default-dispatcher-5 A finished processing Hello A started processing Streams on thread twitter-convert-akka.actor.default-dispatcher-5 B started processing Hello on thread twitter-convert-akka.actor.default-dispatcher-8 B finished processing Hello A finished processing Streams A started processing World! on thread twitter-convert-akka.actor.default-dispatcher-5 C started processing Hello on thread twitter-convert-akka.actor.default-dispatcher-6 B started processing Streams on thread twitter-convert-akka.actor.default-dispatcher-8 B finished processing Streams A finished processing World! C finished processing Hello C started processing Streams on thread twitter-convert-akka.actor.default-dispatcher-6 Got output Hello B started processing World! on thread twitter-convert-akka.actor.default-dispatcher-8 C finished processing Streams B finished processing World! Got output Streams C started processing World! on thread twitter-convert-akka.actor.default-dispatcher-6 C finished processing World! Got output World!
started processing Hello on thread twitter-convert-akka.actor.default-dispatcher-5 A finished processing Hello A started processing Streams on thread twitter-convert-akka.actor.default-dispatcher-5 B started processing Hello on thread twitter-convert-akka.actor.default-dispatcher-8 B finished processing Hello A finished processing Streams A started processing World! on thread twitter-convert-akka.actor.default-dispatcher-5 C started processing Hello on thread twitter-convert-akka.actor.default-dispatcher-6 B started processing Streams on thread twitter-convert-akka.actor.default-dispatcher-8 B finished processing Streams A finished processing World! C finished processing Hello C started processing Streams on thread twitter-convert-akka.actor.default-dispatcher-6 Got output Hello B started processing World! on thread twitter-convert-akka.actor.default-dispatcher-8 C finished processing Streams B finished processing World! Got output Streams C started processing World! on thread twitter-convert-akka.actor.default-dispatcher-6 C finished processing World! Got output World! A B C Hello Hello Hello Streams World! Streams Streams World! val completion = Source(List("Hello", "Streams", "World!")) .via(processingStage("A")).async .via(processingStage("B")).async .via(processingStage("C")).async .runWith(Sink.foreach(s ⇒ println("Got output " + s))) 処理が終わったデータから 次の処理に進んでいる
A started processing Hello on thread twitter-convert-akka.actor.default-dispatcher-4 A finished processing Hello B started processing Hello on thread twitter-convert-akka.actor.default-dispatcher-4 B finished processing Hello C started processing Hello on thread twitter-convert-akka.actor.default-dispatcher-4 C finished processing Hello Got output Hello A started processing Streams on thread twitter-convert-akka.actor.default-dispatcher-4 A finished processing Streams B started processing Streams on thread twitter-convert-akka.actor.default-dispatcher-4 B finished processing Streams C started processing Streams on thread twitter-convert-akka.actor.default-dispatcher-4 C finished processing Streams Got output Streams A started processing World! on thread twitter-convert-akka.actor.default-dispatcher-4 A finished processing World! B started processing World! on thread twitter-convert-akka.actor.default-dispatcher-4 B finished processing World! C started processing World! on thread twitter-convert-akka.actor.default-dispatcher-4 C finished processing World! Got output World!
A started processing Hello on thread twitter-convert-akka.actor.default-dispatcher-4 A finished processing Hello B started processing Hello on thread twitter-convert-akka.actor.default-dispatcher-4 B finished processing Hello C started processing Hello on thread twitter-convert-akka.actor.default-dispatcher-4 C finished processing Hello Got output Hello A started processing Streams on thread twitter-convert-akka.actor.default-dispatcher-4 A finished processing Streams B started processing Streams on thread twitter-convert-akka.actor.default-dispatcher-4 B finished processing Streams C started processing Streams on thread twitter-convert-akka.actor.default-dispatcher-4 C finished processing Streams Got output Streams A started processing World! on thread twitter-convert-akka.actor.default-dispatcher-4 A finished processing World! B started processing World! on thread twitter-convert-akka.actor.default-dispatcher-4 B finished processing World! C started processing World! on thread twitter-convert-akka.actor.default-dispatcher-4 C finished processing World! Got output World! A B C Hello Streams val completion = Source(List("Hello", "Streams", "World!")) .via(processingStage("A")) .via(processingStage("B")) .via(processingStage("C")) .runWith(Sink.foreach(s ⇒ println("Got output " + s))) 処理がすべて終わってから 次の処理に進んでいる Hello Streams Hello Streams