SlideShare una empresa de Scribd logo
1 de 115
Descargar para leer sin conexión
Konrad 'ktoso' Malawski 
GeeCON 2014 @ Kraków, PL 
Akka Streams 
Konrad `@ktosopl` Malawski 
Tokyo Scala User Group @ Tokyo 2014
hAkker @ 
「アッカ」チームのメンバー。 
Konrad `@ktosopl` Malawski
hAkker @ 
Konrad `@ktosopl` Malawski 
typesafe.com 
geecon.org 
Java.pl / KrakowScala.pl 
sckrk.com / meetup.com/Paper-Cup @ London 
GDGKrakow.pl 
meetup.com/Lambda-Lounge-Krakow
ありがとうございました, Benedict! 
For translating the slides!
You? 
?
You? 
? 
z ?
You? 
? 
z ? 
?
You? 
? 
z ? 
? 
?
Streams
Streams
Streams 
“You cannot enter the same river twice” 
~ Heraclitus 
http://en.wikiquote.org/wiki/Heraclitus
Streams 
ライルタイムストリーム処理 
Real Time Stream Processing 
!パブリッシャーにつけることが遅ければ、 
データは川のように流れるため、最初の 
要素を逃がしてしまう可能性がある 
When you attach “late” to a Publisher, 
you may miss initial elements – it’s a river of data. 
http://en.wikiquote.org/wiki/Heraclitus
Reactive Streams
Reactive Streams 
! 
! 
Stream processing
Reactive Streams 
Back-pressured 
! 
Stream processing
Reactive Streams 
Back-pressured 
Asynchronous 
Stream processing
Reactive Streams 
Back-pressured 
Asynchronous 
Stream processing 
Standardised (!)
Reactive Streams: Goals 
1. Back-pressured Asynchronous Stream processing 
! 
2. Standard implemented by many libraries
Reactive Streams - Specification & TCK 
http://reactive-streams.org
Reactive Streams - Who? 
Kaazing Corp. 
rxJava @ Netflix, 
reactor @ Pivotal (SpringSource), 
vert.x @ Red Hat, 
Twitter, 
akka-streams @ Typesafe, 
spray @ Spray.io, 
Oracle, 
java (?) – Doug Lea - SUNY Oswego 
… 
http://reactive-streams.org
Reactive Streams - Inter-op 
システム達を協力させたい. 
We want to make different implementations 
co-operate with each other. 
http://reactive-streams.org
Reactive Streams - Inter-op 
リアクティブストリームのプロトコールを 
使ってシステム達を話し合わせる 
The different implementations “talk to each other” 
using the Reactive Streams protocol. 
http://reactive-streams.org
Reactive Streams - Inter-op 
リアクティブストリームSPIはユーザーAPIではない。 
対象システムのライブラリを使うべき。 
The Reactive Streams SPI is NOT meant to be user-api. 
You should use one of the implementing libraries. 
http://reactive-streams.org
Back-pressure, なにですか?
Back-pressure? Example Without 
Publisher[T] Subscriber[T]
Back-pressure? Example Without 
速度が早いパブリッシャー 
Fast Publisher 速度が遅いサブスクライバー 
Slow Subscriber
Back-pressure? 
Push + NACK model
Back-pressure? Push + NACK model
Back-pressure? Push + NACK model 
通常の場合、サブスクライバーはバッファーがある. 
Subscriber usually has some kind of buffer.
Back-pressure? Push + NACK model
Back-pressure? Push + NACK model
Back-pressure? Push + NACK model 
バッファーが溢れてしまった場合、どうなる? 
What if the buffer overflows?
Back-pressure? Push + NACK model (a) 
有界バッファーを利用して、溢れてしまったメッセージを 
落とし、再送を求める. 
! 
Use bounded buffer, drop messages + require re-sending
Back-pressure? Push + NACK model (a) 
有界バッファーを利用して、溢れてしまったメッセージを 
落とし、再送を求める. 
! 
Use bounded buffer, drop messages + require re-sending 
Kernel does this! 
Routers do this! 
(TCP)
Back-pressure? Push + NACK model (b) 
バッファーの容量を増やす・・・まぁ、 
メモリ容量がある限り! 
Increase buffer size… 
Well, while you have memory available!
Back-pressure? Push + NACK model (b)
Back-pressure? 
Why NACKing is NOT enough
Back-pressure? Example NACKing 
たいへんですよ! 
バッファーが溢れるまで間もなく! 
Buffer overflow is imminent!
Back-pressure? Example NACKing 
データを送る速力を落とす、または送信を停止する、 
ようにパブリッシャーに告げる. 
Telling the Publisher to slow down / stop sending…
Back-pressure? Example NACKing 
メッセージが送信されている最中のため、 
NACKが間に合わなかった! 
NACK did not make it in time, 
because M was in-flight!
Back-pressure? 
! 
パブリッシャーの速度 < サブスクライバーの速度 
speed(publisher) < speed(subscriber)
Back-pressure? Fast Subscriber, No Problem 
速度が速いサブスクライバーなら、問題ない! 
No problem!
Back-pressure? 
Reactive-Streams 
= 
“Dynamic Push/Pull”
Back-pressure? RS: Dynamic Push/Pull 
プッシュ一方 - 速度が遅いサブスクライバーの場合、 
安全じゃない 
Just push – not safe when Slow Subscriber 
! 
! 
プル一方 - 速度早いサブスクライバーの場合、 
遅すぎる 
Just pull – too slow when Fast Subscriber
Back-pressure? RS: Dynamic Push/Pull 
プッシュ一方 - 速度が遅いサブスクライバーの場合、 
安全じゃない 
Just push – not safe when Slow Subscriber 
! 
! 
プル一方 - 速度早いサブスクライバーの場合、 
遅すぎる 
Just pull – too slow when Fast Subscriber 
! 
Solution: 
動的な調整(リアクティブストリーム) 
Dynamic adjustment (Reactive Streams)
Back-pressure? RS: Dynamic Push/Pull 
速度が遅いサブスクライバーは自分のバッ 
ファーが3つの要素まで受け取られる。パブリッ 
シャーはサブスクライバーのバッファーが溢れ 
るほどデータを送らない。Slow Subscriber sees it’s buffer can 
take 3 elements. Publisher will never blow up it’s buffer.
Back-pressure? RS: Dynamic Push/Pull 
速度が速いパブリッシャーは最大でも3つの要 
素を送る。これは、プル型のback-pressure. 
Fast Publisher will send at-most 3 elements. This is pull-based-backpressure.
Back-pressure? RS: Dynamic Push/Pull 
速度が速いサブスクライバーは、実際のデータ 
が届く前に、たくさんリクエストを送ることが 
できる!Fast Subscriber can issue more Request(n), before more data arrives!
Back-pressure? RS: Dynamic Push/Pull 
パブリッシャーはサブスクライバーの全てのリ 
クエストを溜める. 
Fast Subscriber can issue more Request(n), before more data 
arrives. Publisher can accumulate demand.
Back-pressure? RS: Accumulate demand 
パブリッシャーはサブスクライバーの全ての 
リクエストを溜める. Publisher accumulates total demand per subscriber.
Back-pressure? RS: Accumulate demand 
溜まった要素をパブリッシュすることは安全だ。 
サブスクライバーのバッファーは溢れない。 
Total demand of elements is safe to publish. 
Subscriber’s buffer will not overflow.
Back-pressure? RS: Requesting “a lot” 
速度が速いサブスクライバーは、パブリッ 
シャーに対し要求が多くても良い。これは「パ 
ブリッシャー・プッシュ」だ。バッファー容量 
は知られているので、安全だ。
Back-pressure? RS: Requesting “a lot” 
Fast Subscriber, can request “a lot” from Publisher. 
This is effectively “publisher push”, and is really fast. 
Buffer size is known and this is safe.
Back-pressure? RS: Dynamic Push/Pull 
MAX速度
Back-pressure? RS: Dynamic Push/Pull 
安全!溢れ 
ること絶対 
ない! 
MAX速度
わなにですか?
Akka = アッカ 
Akka is a high-performance concurrency 
library for Scala and Java. 
! 
At it’s core it focuses on the Actor Model:
Akka = アッカ 
Akka is a high-performance concurrency 
library for Scala and Java. 
! 
At it’s core it focuses on the Actor Model: 
アクターができること: 
• メッセージを送信・受信する (Send / receive messages) 
• アクターを作る (Create Actors) 
• 自分の動作を変える (Change it’s behaviour)
Akka 
Akka has multiple modules: 
! 
Akka-camel: integration 
Akka-remote: remote actors 
Akka-cluster: clustering 
Akka-persistence: CQRS / Event Sourcing 
Akka-streams: stream processing 
…
Akka Streams 
0.7 early preview
Akka Streams – Linear Flow
Akka Streams – Linear Flow
Akka Streams – Linear Flow
Akka Streams – Linear Flow
Akka Streams – Linear Flow 
FlowFrom[Double].map(_.toInt). [...] 
ソースはまだ付けられていない. 
パイプはダブルを処理する準備を整いた. 
No Source attached yet. 
“Pipe ready to work with Doubles”.
Akka Streams – Linear Flow 
implicit val sys = ActorSystem("tokyo-sys")! 
! 
アクターが住んでいる世界. 
AkkaStreamsはアクターを使うため、 
アクターシステムは必要. 
! 
ActorSystem is the world in which Actors live in. 
AkkaStreams uses Actors, so it needs ActorSystem.
Akka Streams – Linear Flow 
implicit val sys = ActorSystem("tokyo-sys")! 
implicit val mat = FlowMaterializer()! 
ストリームをどうやって具体化するかの 
ロジックが含まれている. 
! 
Contains logic on HOW to materialise the stream.
Akka Streams – Linear Flow 
implicit val sys = ActorSystem("tokyo-sys")! 
implicit val mat = FlowMaterializer()! 
単純にアクターか、 
もしくは実装されていれば、 
Apache Spark (?!) 
! 
A materialiser can choose HOW to materialise, it could even use 
Apache Spark (?!) if someone would implement that… :-)
Akka Streams – Linear Flow 
implicit val sys = ActorSystem("tokyo-sys")! 
implicit val mat = FlowMaterializer()! 
バッファーの容量を設定できるなど 
! 
You can configure it’s buffer sizes etc.
Akka Streams – Linear Flow 
implicit val sys = ActorSystem("tokyo-sys")! 
implicit val mat = FlowMaterializer()! 
val foreachSink = ForeachSink[Int](println)! 
val mf = FlowFrom(1 to 3).withSink(foreachSink).run() 
Uses the implicit FlowMaterializer
Akka Streams – Linear Flow 
implicit val sys = ActorSystem("tokyo-sys")! 
implicit val mat = FlowMaterializer()! 
val foreachSink = ForeachSink[Int](println)! 
val mf = FlowFrom(1 to 3).withSink(foreachSink).run()(mat)
Akka Streams – Linear Flow 
val mf = FlowFrom[Int].! 
map(_ * 2).! 
withSink(ForeachSink(println)) // needs source,! 
// can NOT run 
走らせるためにソースが必要!
Akka Streams – Linear Flow 
val f = FlowFrom[Int].! 
map(_ * 2).! 
! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! 
! ! // needs Source to run! 
インプットが必要 
走らせるためにソースが必要!
Akka Streams – Linear Flow 
val f = FlowFrom[Int].! 
map(_ * 2).! 
! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! 
! ! // needs Source to run!
Akka Streams – Linear Flow 
val f = FlowFrom[Int].! 
map(_ * 2).! 
! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! 
! ! // needs Source to run!
Akka Streams – Linear Flow 
val f = FlowFrom[Int].! 
map(_ * 2).! 
! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! 
! ! // needs Source to run! 
! 
! ! ! f.withSource(IterableSource(1 to 10)).run() 
準備完了!
Akka Streams – Linear Flow 
val f = FlowFrom[Int].! 
map(_ * 2).! 
! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! 
! ! // needs Source to run! 
! 
! ! ! f.withSource(IterableSource(1 to 10)).run() 
準備完了!
Akka Streams – Flows are reusable 
! 
! ! ! f.withSource(IterableSource(1 to 10)).run()! 
! ! ! f.withSource(IterableSource(1 to 100)).run()! 
! ! ! f.withSource(IterableSource(1 to 1000)).run()
Akka Streams <-> Actors – Advanced 
val subscriber = system.actorOf(Props[SubStreamParent], ”parent")! 
! 
FlowFrom(1 to 100).! 
map(_.toString).! 
filter(_.length == 2).! 
drop(2).! 
groupBy(_.last).! 
publishTo(ActorSubscriber(subscriber))!
Akka Streams <-> Actors – Advanced 
val subscriber = system.actorOf(Props[SubStreamParent], ”parent")! 
! 
FlowFrom(1 to 100).! 
map(_.toString).! 
filter(_.length == 2).! 
drop(2).! 
groupBy(_.last).! 
publishTo(ActorSubscriber(subscriber))! 
各グループもストリームだよ! 
Each “group” is a stream too! It’s a “Stream of Streams”.
Akka Streams <-> Actors – Advanced 
! 
groupBy(_.last). 
「11」をグループ「1」に、「12」をグループ「2」になど 
GroupBy groups “11” to group “1”, “12” to group “2” etc.
Akka Streams <-> Actors – Advanced 
! 
groupBy(_.last). 
サブスクライバーに[グループキー、サブストリームフロー]を提供する 
It offers (groupKey, subStreamFlow) to Subscriber
Akka Streams <-> Actors – Advanced 
! 
groupBy(_.last). 
子供を起動させ、サブーフローを扱わせる 
It can then start children, to handle the sub-flows!
Akka Streams <-> Actors – Advanced 
! 
groupBy(_.last). 
例えば、グループ毎に1人の子供 
For example, one child for each group.
Akka Streams <-> Actors – Advanced 
val subscriber = system.actorOf(Props[SubStreamParent], ”parent")! 
! 
FlowFrom(1 to 100).! 
map(_.toString).! 
filter(_.length == 2).! 
drop(2).! 
groupBy(_.last).! 
publishTo(ActorSubscriber(subscriber))! 
普通 Akka Actor, will consume SubStream offers.
Akka Streams <-> Actors – Advanced 
class SubStreamParent extends ActorSubscriber ! 
with ImplicitFlowMaterializer ! 
with ActorLogging {! 
! 
override def requestStrategy = OneByOneRequestStrategy! 
! 
override def receive = {! 
case OnNext((groupId: String, subStream: FlowWithSource[_, _])) =>! 
! 
val subSub = context.actorOf(Props[SubStreamSubscriber], ! 
s"sub-$groupId")! 
subStream.publishTo(ActorSubscriber(subSub))! 
}! 
}!
Akka Streams <-> Actors – Advanced 
class SubStreamParent extends ActorSubscriber ! 
with ImplicitFlowMaterializer ! 
with ActorLogging {! 
! 
override def requestStrategy = OneByOneRequestStrategy! 
! 
override def receive = {! 
case OnNext((groupId: String, subStream: FlowWithSource[_, _])) =>! 
! 
val subSub = context.actorOf(Props[SubStreamSubscriber], ! 
s"sub-$groupId")! 
subStream.publishTo(ActorSubscriber(subSub))! 
}! 
}!
Akka Streams <-> Actors – Advanced 
class SubStreamParent extends ActorSubscriber ! 
with ImplicitFlowMaterializer ! 
with ActorLogging {! 
! 
override def requestStrategy = OneByOneRequestStrategy! 
! 
override def receive = {! 
case OnNext((groupId: String, subStream: FlowWithSource[_, _])) =>! 
! 
val subSub = context.actorOf(Props[SubStreamSubscriber], ! 
s"sub-$groupId")! 
subStream.publishTo(ActorSubscriber(subSub))! 
}! 
}!
Akka Streams <-> Actors – Advanced 
class SubStreamParent extends ActorSubscriber ! 
with ImplicitFlowMaterializer ! 
with ActorLogging {! 
! 
override def requestStrategy = OneByOneRequestStrategy! 
! 
override def receive = {! 
case OnNext((groupId: String, subStream: FlowWithSource[_, _])) =>! 
! 
val subSub = context.actorOf(Props[SubStreamSubscriber], ! 
s"sub-$groupId")! 
subStream.publishTo(ActorSubscriber(subSub))! 
}! 
}!
Akka Streams <-> Actors – Advanced 
class SubStreamParent extends ActorSubscriber ! 
with ImplicitFlowMaterializer ! 
with ActorLogging {! 
! 
override def requestStrategy = OneByOneRequestStrategy! 
! 
override def receive = {! 
case OnNext((groupId: String, subStream: FlowWithSource[_, _])) =>! 
! 
val subSub = context.actorOf(Props[SubStreamSubscriber], ! 
s"sub-$groupId")! 
subStream.publishTo(ActorSubscriber(subSub))! 
}! 
}!
Akka Streams <-> Actors – Advanced 
class SubStreamParent extends ActorSubscriber {! 
! 
override def requestStrategy = OneByOneRequestStrategy! 
! 
override def receive = {! 
case OnNext(n: String) => println(s”n = $n”) ! 
}! 
}!
Akka Streams – GraphFlow 
GraphFlow
Akka Streams – GraphFlow 
Linear Flows 
or 
non-akka pipelines 
Could be another RS implementation!
Akka Streams – GraphFlow 
Fan-out elements 
and 
Fan-in elements
Akka Streams – GraphFlow 
Fan-out elements 
and 
Fan-in elements 
Now you need a FlowGraph
Akka Streams – GraphFlow 
// first define some pipeline pieces! 
val f1 = FlowFrom[Input].map(_.toIntermediate)! 
val f2 = FlowFrom[Intermediate].map(_.enrich)! 
val f3 = FlowFrom[Enriched].filter(_.isImportant)! 
val f4 = FlowFrom[Intermediate].mapFuture(_.enrichAsync)! 
! 
// then add input and output placeholders! 
val in = SubscriberSource[Input]! 
val out = PublisherSink[Enriched]!
Akka Streams – GraphFlow
Akka Streams – GraphFlow 
val b3 = Broadcast[Int]("b3")! 
val b7 = Broadcast[Int]("b7")! 
val b11 = Broadcast[Int]("b11")! 
val m8 = Merge[Int]("m8")! 
val m9 = Merge[Int]("m9")! 
val m10 = Merge[Int]("m10")! 
val m11 = Merge[Int]("m11")! 
val in3 = IterableSource(List(3))! 
val in5 = IterableSource(List(5))! 
val in7 = IterableSource(List(7))!
Akka Streams – GraphFlow
Akka Streams – GraphFlow 
// First layer! 
in7 ~> b7! 
b7 ~> m11! 
b7 ~> m8! 
! 
in5 ~> m11! 
! 
in3 ~> b3! 
b3 ~> m8! 
b3 ~> m10!
Akka Streams – GraphFlow 
! 
// Second layer! 
m11 ~> b11! 
b11 ~> FlowFrom[Int].grouped(1000) ~> resultFuture2 ! 
b11 ~> m9! 
b11 ~> m10! 
! 
m8 ~> m9!
Akka Streams – GraphFlow 
! 
// Third layer! 
m9 ~> FlowFrom[Int].grouped(1000) ~> resultFuture9! 
m10 ~> FlowFrom[Int].grouped(1000) ~> resultFuture10!
Akka Streams – GraphFlow 
! 
// Third layer! 
m9 ~> FlowFrom[Int].grouped(1000) ~> resultFuture9! 
m10 ~> FlowFrom[Int].grouped(1000) ~> resultFuture10!
Akka Streams – GraphFlow 
! 
// Third layer! 
m9 ~> FlowFrom[Int].grouped(1000) ~> resultFuture9! 
m10 ~> FlowFrom[Int].grouped(1000) ~> resultFuture10!
Akka Streams – GraphFlow 
Sinks and Sources are “keys” 
which can be addressed within the graph 
val resultFuture2 = FutureSink[Seq[Int]]! 
val resultFuture9 = FutureSink[Seq[Int]]! 
val resultFuture10 = FutureSink[Seq[Int]]! 
! 
val g = FlowGraph { implicit b =>! 
// ...! 
m10 ~> FlowFrom[Int].grouped(1000) ~> resultFuture10! 
// ...! 
}.run()! 
! 
Await.result(g.getSinkFor(resultFuture2), 3.seconds).sorted! 
should be(List(5, 7))
Akka Streams – GraphFlow 
Sinks and Sources are “keys” 
which can be addressed within the graph 
val resultFuture2 = FutureSink[Seq[Int]]! 
val resultFuture9 = FutureSink[Seq[Int]]! 
val resultFuture10 = FutureSink[Seq[Int]]! 
! 
val g = FlowGraph { implicit b =>! 
// ...! 
m10 ~> FlowFrom[Int].grouped(1000) ~> resultFuture10! 
// ...! 
}.run()! 
! 
Await.result(g.getSinkFor(resultFuture2), 3.seconds).sorted! 
should be(List(5, 7))
Akka Streams – GraphFlow 
! 
val g = FlowGraph {}! 
FlowGraphは不変で、安全に共有でき、 
何度も使いまわせる! 
! 
FlowGraph is immutable and safe to share and re-use! 
Think of it as “the description” which then gets “run”.
Available Elements 
0.7 early preview
Available Sources 
• FutureSource 
• IterableSource 
• IteratorSource 
• PublisherSource 
• SubscriberSource 
• ThunkSource 
• TickSource (timer based) 
• 簡単に自分のものを追加できる! 
… easy to add your own! 
0.7 early preview
Available operations 
• buffer 
• collect 
• concat 
• conflate 
• drop / dropWithin 
• take / takeWithin 
• filter 
• fold 
• foreach 
• groupBy 
• grouped 
• map 
• onComplete 
• prefixAndTail 
• broadcast 
• merge / “generalised merge” 
• zip 
• 自分のオペレーションを追加する事は可能! 
… possible to add your own! 
0.7 early preview
Available Sinks 
• BlackHoleSink 
• FoldSink 
• ForeachSink 
• FutureSink 
• OnCompleteSink 
• PublisherSink / FanoutPublisherSink 
• SubscriberSink 
• 簡単に自分のものを追加できる! 
… easy to add your own! 
0.7 early preview
Spray => Akka-Http && ReactiveStreams 
Spray is now merged into Akka, as Akka-Http 
Works on Reactive Streams 
Streaming end-to-end!
Links 
• http://akka.io 
• http://reactive-streams.org 
• https://groups.google.com/group/akka-user <- ask questions here! 
• http://akka.io/news/2014/09/12/akka-streams-0.7-released.html
ありがとう 
ございました! 
Ask questions, 
get Stickers! 
http://akka.io 
ktoso @ typesafe.com 
twitter: ktosopl 
github: ktoso 
team blog: letitcrash.com
©Typesafe 2014 – All Rights Reserved

Más contenido relacionado

La actualidad más candente

Akka Streams in Action @ ScalaDays Berlin 2016
Akka Streams in Action @ ScalaDays Berlin 2016Akka Streams in Action @ ScalaDays Berlin 2016
Akka Streams in Action @ ScalaDays Berlin 2016Konrad Malawski
 
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...Reactivesummit
 
Reactive Streams, j.u.concurrent & Beyond!
Reactive Streams, j.u.concurrent & Beyond!Reactive Streams, j.u.concurrent & Beyond!
Reactive Streams, j.u.concurrent & Beyond!Konrad Malawski
 
State of Akka 2017 - The best is yet to come
State of Akka 2017 - The best is yet to comeState of Akka 2017 - The best is yet to come
State of Akka 2017 - The best is yet to comeKonrad Malawski
 
End to End Akka Streams / Reactive Streams - from Business to Socket
End to End Akka Streams / Reactive Streams - from Business to SocketEnd to End Akka Streams / Reactive Streams - from Business to Socket
End to End Akka Streams / Reactive Streams - from Business to SocketKonrad Malawski
 
Journey into Reactive Streams and Akka Streams
Journey into Reactive Streams and Akka StreamsJourney into Reactive Streams and Akka Streams
Journey into Reactive Streams and Akka StreamsKevin Webber
 
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYC
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYCBuilding a Reactive System with Akka - Workshop @ O'Reilly SAConf NYC
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYCKonrad Malawski
 
Streaming all the things with akka streams
Streaming all the things with akka streams   Streaming all the things with akka streams
Streaming all the things with akka streams Johan Andrén
 
Reactive Streams: Handling Data-Flow the Reactive Way
Reactive Streams: Handling Data-Flow the Reactive WayReactive Streams: Handling Data-Flow the Reactive Way
Reactive Streams: Handling Data-Flow the Reactive WayRoland Kuhn
 
VJUG24 - Reactive Integrations with Akka Streams
VJUG24  - Reactive Integrations with Akka StreamsVJUG24  - Reactive Integrations with Akka Streams
VJUG24 - Reactive Integrations with Akka StreamsJohan Andrén
 
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...Konrad Malawski
 
How Reactive Streams & Akka Streams change the JVM Ecosystem
How Reactive Streams & Akka Streams change the JVM EcosystemHow Reactive Streams & Akka Streams change the JVM Ecosystem
How Reactive Streams & Akka Streams change the JVM EcosystemKonrad Malawski
 
The Need for Async @ ScalaWorld
The Need for Async @ ScalaWorldThe Need for Async @ ScalaWorld
The Need for Async @ ScalaWorldKonrad Malawski
 
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...Lightbend
 
The Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOneThe Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOneKonrad Malawski
 
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
Understanding Akka Streams, Back Pressure, and Asynchronous ArchitecturesUnderstanding Akka Streams, Back Pressure, and Asynchronous Architectures
Understanding Akka Streams, Back Pressure, and Asynchronous ArchitecturesLightbend
 
A dive into akka streams: from the basics to a real-world scenario
A dive into akka streams: from the basics to a real-world scenarioA dive into akka streams: from the basics to a real-world scenario
A dive into akka streams: from the basics to a real-world scenarioGioia Ballin
 
HBase RowKey design for Akka Persistence
HBase RowKey design for Akka PersistenceHBase RowKey design for Akka Persistence
HBase RowKey design for Akka PersistenceKonrad Malawski
 
How to manage large amounts of data with akka streams
How to manage large amounts of data with akka streamsHow to manage large amounts of data with akka streams
How to manage large amounts of data with akka streamsIgor Mielientiev
 

La actualidad más candente (20)

Akka Streams in Action @ ScalaDays Berlin 2016
Akka Streams in Action @ ScalaDays Berlin 2016Akka Streams in Action @ ScalaDays Berlin 2016
Akka Streams in Action @ ScalaDays Berlin 2016
 
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Ka...
 
Reactive Streams, j.u.concurrent & Beyond!
Reactive Streams, j.u.concurrent & Beyond!Reactive Streams, j.u.concurrent & Beyond!
Reactive Streams, j.u.concurrent & Beyond!
 
State of Akka 2017 - The best is yet to come
State of Akka 2017 - The best is yet to comeState of Akka 2017 - The best is yet to come
State of Akka 2017 - The best is yet to come
 
End to End Akka Streams / Reactive Streams - from Business to Socket
End to End Akka Streams / Reactive Streams - from Business to SocketEnd to End Akka Streams / Reactive Streams - from Business to Socket
End to End Akka Streams / Reactive Streams - from Business to Socket
 
Akka streams
Akka streamsAkka streams
Akka streams
 
Journey into Reactive Streams and Akka Streams
Journey into Reactive Streams and Akka StreamsJourney into Reactive Streams and Akka Streams
Journey into Reactive Streams and Akka Streams
 
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYC
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYCBuilding a Reactive System with Akka - Workshop @ O'Reilly SAConf NYC
Building a Reactive System with Akka - Workshop @ O'Reilly SAConf NYC
 
Streaming all the things with akka streams
Streaming all the things with akka streams   Streaming all the things with akka streams
Streaming all the things with akka streams
 
Reactive Streams: Handling Data-Flow the Reactive Way
Reactive Streams: Handling Data-Flow the Reactive WayReactive Streams: Handling Data-Flow the Reactive Way
Reactive Streams: Handling Data-Flow the Reactive Way
 
VJUG24 - Reactive Integrations with Akka Streams
VJUG24  - Reactive Integrations with Akka StreamsVJUG24  - Reactive Integrations with Akka Streams
VJUG24 - Reactive Integrations with Akka Streams
 
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...
[Japanese] How Reactive Streams and Akka Streams change the JVM Ecosystem @ R...
 
How Reactive Streams & Akka Streams change the JVM Ecosystem
How Reactive Streams & Akka Streams change the JVM EcosystemHow Reactive Streams & Akka Streams change the JVM Ecosystem
How Reactive Streams & Akka Streams change the JVM Ecosystem
 
The Need for Async @ ScalaWorld
The Need for Async @ ScalaWorldThe Need for Async @ ScalaWorld
The Need for Async @ ScalaWorld
 
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...
Build Real-Time Streaming ETL Pipelines With Akka Streams, Alpakka And Apache...
 
The Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOneThe Cloud-natives are RESTless @ JavaOne
The Cloud-natives are RESTless @ JavaOne
 
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
Understanding Akka Streams, Back Pressure, and Asynchronous ArchitecturesUnderstanding Akka Streams, Back Pressure, and Asynchronous Architectures
Understanding Akka Streams, Back Pressure, and Asynchronous Architectures
 
A dive into akka streams: from the basics to a real-world scenario
A dive into akka streams: from the basics to a real-world scenarioA dive into akka streams: from the basics to a real-world scenario
A dive into akka streams: from the basics to a real-world scenario
 
HBase RowKey design for Akka Persistence
HBase RowKey design for Akka PersistenceHBase RowKey design for Akka Persistence
HBase RowKey design for Akka Persistence
 
How to manage large amounts of data with akka streams
How to manage large amounts of data with akka streamsHow to manage large amounts of data with akka streams
How to manage large amounts of data with akka streams
 

Similar a 2014 akka-streams-tokyo-japanese

Reactive Streams 1.0 and Akka Streams
Reactive Streams 1.0 and Akka StreamsReactive Streams 1.0 and Akka Streams
Reactive Streams 1.0 and Akka StreamsDean Wampler
 
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache KafkaExploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache KafkaLightbend
 
Introduction to Akka Streams [Part-I]
Introduction to Akka Streams [Part-I]Introduction to Akka Streams [Part-I]
Introduction to Akka Streams [Part-I]Knoldus Inc.
 
Mirco Dotta - Akka Streams
Mirco Dotta - Akka StreamsMirco Dotta - Akka Streams
Mirco Dotta - Akka StreamsScala Italy
 
Introduction to Apache Beam & No Shard Left Behind: APIs for Massive Parallel...
Introduction to Apache Beam & No Shard Left Behind: APIs for Massive Parallel...Introduction to Apache Beam & No Shard Left Behind: APIs for Massive Parallel...
Introduction to Apache Beam & No Shard Left Behind: APIs for Massive Parallel...Dan Halperin
 
Scala usergroup stockholm - reactive integrations with akka streams
Scala usergroup stockholm - reactive integrations with akka streamsScala usergroup stockholm - reactive integrations with akka streams
Scala usergroup stockholm - reactive integrations with akka streamsJohan Andrén
 
Reactive Summit 2017 Highlights!
Reactive Summit 2017 Highlights!Reactive Summit 2017 Highlights!
Reactive Summit 2017 Highlights!Fabio Tiriticco
 
Apache Kafka and KSQL in Action: Let's Build a Streaming Data Pipeline!
Apache Kafka and KSQL in Action: Let's Build a Streaming Data Pipeline!Apache Kafka and KSQL in Action: Let's Build a Streaming Data Pipeline!
Apache Kafka and KSQL in Action: Let's Build a Streaming Data Pipeline!confluent
 
Reactive stream processing using Akka streams
Reactive stream processing using Akka streams Reactive stream processing using Akka streams
Reactive stream processing using Akka streams Johan Andrén
 
Four Things to Know About Reliable Spark Streaming with Typesafe and Databricks
Four Things to Know About Reliable Spark Streaming with Typesafe and DatabricksFour Things to Know About Reliable Spark Streaming with Typesafe and Databricks
Four Things to Know About Reliable Spark Streaming with Typesafe and DatabricksLegacy Typesafe (now Lightbend)
 
Akka in Production - ScalaDays 2015
Akka in Production - ScalaDays 2015Akka in Production - ScalaDays 2015
Akka in Production - ScalaDays 2015Evan Chan
 
Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...
Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...
Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...Lightbend
 
Paris jug ksql - 2018-06-28
Paris jug ksql - 2018-06-28Paris jug ksql - 2018-06-28
Paris jug ksql - 2018-06-28Florent Ramiere
 
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Kafka
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & KafkaBack-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Kafka
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & KafkaAkara Sucharitakul
 
Akka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming WorldAkka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming WorldKonrad Malawski
 
DustinVannoy_DataPipelines_AzureDataConf_Dec22.pdf
DustinVannoy_DataPipelines_AzureDataConf_Dec22.pdfDustinVannoy_DataPipelines_AzureDataConf_Dec22.pdf
DustinVannoy_DataPipelines_AzureDataConf_Dec22.pdfDustin Vannoy
 
Reactor, Reactive streams and MicroServices
Reactor, Reactive streams and MicroServicesReactor, Reactive streams and MicroServices
Reactor, Reactive streams and MicroServicesStéphane Maldini
 
Alpakka - Connecting Kafka and ElasticSearch to Akka Streams
Alpakka - Connecting Kafka and ElasticSearch to Akka StreamsAlpakka - Connecting Kafka and ElasticSearch to Akka Streams
Alpakka - Connecting Kafka and ElasticSearch to Akka StreamsKnoldus Inc.
 

Similar a 2014 akka-streams-tokyo-japanese (20)

Reactive Streams 1.0 and Akka Streams
Reactive Streams 1.0 and Akka StreamsReactive Streams 1.0 and Akka Streams
Reactive Streams 1.0 and Akka Streams
 
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache KafkaExploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
Exploring Reactive Integrations With Akka Streams, Alpakka And Apache Kafka
 
Introduction to Akka Streams [Part-I]
Introduction to Akka Streams [Part-I]Introduction to Akka Streams [Part-I]
Introduction to Akka Streams [Part-I]
 
Mirco Dotta - Akka Streams
Mirco Dotta - Akka StreamsMirco Dotta - Akka Streams
Mirco Dotta - Akka Streams
 
Introduction to Apache Beam & No Shard Left Behind: APIs for Massive Parallel...
Introduction to Apache Beam & No Shard Left Behind: APIs for Massive Parallel...Introduction to Apache Beam & No Shard Left Behind: APIs for Massive Parallel...
Introduction to Apache Beam & No Shard Left Behind: APIs for Massive Parallel...
 
Intro to Akka Streams
Intro to Akka StreamsIntro to Akka Streams
Intro to Akka Streams
 
Scala usergroup stockholm - reactive integrations with akka streams
Scala usergroup stockholm - reactive integrations with akka streamsScala usergroup stockholm - reactive integrations with akka streams
Scala usergroup stockholm - reactive integrations with akka streams
 
Reactive Summit 2017 Highlights!
Reactive Summit 2017 Highlights!Reactive Summit 2017 Highlights!
Reactive Summit 2017 Highlights!
 
Apache Kafka and KSQL in Action: Let's Build a Streaming Data Pipeline!
Apache Kafka and KSQL in Action: Let's Build a Streaming Data Pipeline!Apache Kafka and KSQL in Action: Let's Build a Streaming Data Pipeline!
Apache Kafka and KSQL in Action: Let's Build a Streaming Data Pipeline!
 
Reactive stream processing using Akka streams
Reactive stream processing using Akka streams Reactive stream processing using Akka streams
Reactive stream processing using Akka streams
 
Four Things to Know About Reliable Spark Streaming with Typesafe and Databricks
Four Things to Know About Reliable Spark Streaming with Typesafe and DatabricksFour Things to Know About Reliable Spark Streaming with Typesafe and Databricks
Four Things to Know About Reliable Spark Streaming with Typesafe and Databricks
 
Spark streaming + kafka 0.10
Spark streaming + kafka 0.10Spark streaming + kafka 0.10
Spark streaming + kafka 0.10
 
Akka in Production - ScalaDays 2015
Akka in Production - ScalaDays 2015Akka in Production - ScalaDays 2015
Akka in Production - ScalaDays 2015
 
Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...
Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...
Lessons Learned From PayPal: Implementing Back-Pressure With Akka Streams And...
 
Paris jug ksql - 2018-06-28
Paris jug ksql - 2018-06-28Paris jug ksql - 2018-06-28
Paris jug ksql - 2018-06-28
 
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Kafka
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & KafkaBack-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Kafka
Back-Pressure in Action: Handling High-Burst Workloads with Akka Streams & Kafka
 
Akka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming WorldAkka-chan's Survival Guide for the Streaming World
Akka-chan's Survival Guide for the Streaming World
 
DustinVannoy_DataPipelines_AzureDataConf_Dec22.pdf
DustinVannoy_DataPipelines_AzureDataConf_Dec22.pdfDustinVannoy_DataPipelines_AzureDataConf_Dec22.pdf
DustinVannoy_DataPipelines_AzureDataConf_Dec22.pdf
 
Reactor, Reactive streams and MicroServices
Reactor, Reactive streams and MicroServicesReactor, Reactive streams and MicroServices
Reactor, Reactive streams and MicroServices
 
Alpakka - Connecting Kafka and ElasticSearch to Akka Streams
Alpakka - Connecting Kafka and ElasticSearch to Akka StreamsAlpakka - Connecting Kafka and ElasticSearch to Akka Streams
Alpakka - Connecting Kafka and ElasticSearch to Akka Streams
 

Más de Konrad Malawski

Networks and Types - the Future of Akka @ ScalaDays NYC 2018
Networks and Types - the Future of Akka @ ScalaDays NYC 2018Networks and Types - the Future of Akka @ ScalaDays NYC 2018
Networks and Types - the Future of Akka @ ScalaDays NYC 2018Konrad Malawski
 
Akka Typed (quick talk) - JFokus 2018
Akka Typed (quick talk) - JFokus 2018Akka Typed (quick talk) - JFokus 2018
Akka Typed (quick talk) - JFokus 2018Konrad Malawski
 
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in'tScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in'tKonrad Malawski
 
Not Only Streams for Akademia JLabs
Not Only Streams for Akademia JLabsNot Only Streams for Akademia JLabs
Not Only Streams for Akademia JLabsKonrad Malawski
 
Krakow communities @ 2016
Krakow communities @ 2016Krakow communities @ 2016
Krakow communities @ 2016Konrad Malawski
 
The things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and AkkaThe things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and AkkaKonrad Malawski
 
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRKKonrad Malawski
 
Need for Async: Hot pursuit for scalable applications
Need for Async: Hot pursuit for scalable applicationsNeed for Async: Hot pursuit for scalable applications
Need for Async: Hot pursuit for scalable applicationsKonrad Malawski
 
Distributed Consensus A.K.A. "What do we eat for lunch?"
Distributed Consensus A.K.A. "What do we eat for lunch?"Distributed Consensus A.K.A. "What do we eat for lunch?"
Distributed Consensus A.K.A. "What do we eat for lunch?"Konrad Malawski
 
Open soucerers - jak zacząć swoją przygodę z open source
Open soucerers - jak zacząć swoją przygodę z open sourceOpen soucerers - jak zacząć swoją przygodę z open source
Open soucerers - jak zacząć swoją przygodę z open sourceKonrad Malawski
 
Scalding - the not-so-basics @ ScalaDays 2014
Scalding - the not-so-basics @ ScalaDays 2014Scalding - the not-so-basics @ ScalaDays 2014
Scalding - the not-so-basics @ ScalaDays 2014Konrad Malawski
 
DDDing Tools = Akka Persistence
DDDing Tools = Akka PersistenceDDDing Tools = Akka Persistence
DDDing Tools = Akka PersistenceKonrad Malawski
 
Akka persistence == event sourcing in 30 minutes
Akka persistence == event sourcing in 30 minutesAkka persistence == event sourcing in 30 minutes
Akka persistence == event sourcing in 30 minutesKonrad Malawski
 

Más de Konrad Malawski (14)

Networks and Types - the Future of Akka @ ScalaDays NYC 2018
Networks and Types - the Future of Akka @ ScalaDays NYC 2018Networks and Types - the Future of Akka @ ScalaDays NYC 2018
Networks and Types - the Future of Akka @ ScalaDays NYC 2018
 
Akka Typed (quick talk) - JFokus 2018
Akka Typed (quick talk) - JFokus 2018Akka Typed (quick talk) - JFokus 2018
Akka Typed (quick talk) - JFokus 2018
 
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in'tScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
ScalaSwarm 2017 Keynote: Tough this be madness yet theres method in't
 
Not Only Streams for Akademia JLabs
Not Only Streams for Akademia JLabsNot Only Streams for Akademia JLabs
Not Only Streams for Akademia JLabs
 
Krakow communities @ 2016
Krakow communities @ 2016Krakow communities @ 2016
Krakow communities @ 2016
 
The things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and AkkaThe things we don't see – stories of Software, Scala and Akka
The things we don't see – stories of Software, Scala and Akka
 
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK
100th SCKRK Meeting - best software engineering papers of 5 years of SCKRK
 
Zen of Akka
Zen of AkkaZen of Akka
Zen of Akka
 
Need for Async: Hot pursuit for scalable applications
Need for Async: Hot pursuit for scalable applicationsNeed for Async: Hot pursuit for scalable applications
Need for Async: Hot pursuit for scalable applications
 
Distributed Consensus A.K.A. "What do we eat for lunch?"
Distributed Consensus A.K.A. "What do we eat for lunch?"Distributed Consensus A.K.A. "What do we eat for lunch?"
Distributed Consensus A.K.A. "What do we eat for lunch?"
 
Open soucerers - jak zacząć swoją przygodę z open source
Open soucerers - jak zacząć swoją przygodę z open sourceOpen soucerers - jak zacząć swoją przygodę z open source
Open soucerers - jak zacząć swoją przygodę z open source
 
Scalding - the not-so-basics @ ScalaDays 2014
Scalding - the not-so-basics @ ScalaDays 2014Scalding - the not-so-basics @ ScalaDays 2014
Scalding - the not-so-basics @ ScalaDays 2014
 
DDDing Tools = Akka Persistence
DDDing Tools = Akka PersistenceDDDing Tools = Akka Persistence
DDDing Tools = Akka Persistence
 
Akka persistence == event sourcing in 30 minutes
Akka persistence == event sourcing in 30 minutesAkka persistence == event sourcing in 30 minutes
Akka persistence == event sourcing in 30 minutes
 

Último

React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkPixlogix Infotech
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Kaya Weers
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersNicole Novielli
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructureitnewsafrica
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...itnewsafrica
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfpanagenda
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesManik S Magar
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesBernd Ruecker
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxLoriGlavin3
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfLoriGlavin3
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesThousandEyes
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 

Último (20)

React Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App FrameworkReact Native vs Ionic - The Best Mobile App Framework
React Native vs Ionic - The Best Mobile App Framework
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)Design pattern talk by Kaya Weers - 2024 (v2)
Design pattern talk by Kaya Weers - 2024 (v2)
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
A Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software DevelopersA Journey Into the Emotions of Software Developers
A Journey Into the Emotions of Software Developers
 
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data PrivacyTrustArc Webinar - How to Build Consumer Trust Through Data Privacy
TrustArc Webinar - How to Build Consumer Trust Through Data Privacy
 
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical InfrastructureVarsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
Varsha Sewlal- Cyber Attacks on Critical Critical Infrastructure
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...Abdul Kader Baba- Managing Cybersecurity Risks  and Compliance Requirements i...
Abdul Kader Baba- Managing Cybersecurity Risks and Compliance Requirements i...
 
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdfSo einfach geht modernes Roaming fuer Notes und Nomad.pdf
So einfach geht modernes Roaming fuer Notes und Nomad.pdf
 
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotesMuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
MuleSoft Online Meetup Group - B2B Crash Course: Release SparkNotes
 
Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
QCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architecturesQCon London: Mastering long-running processes in modern architectures
QCon London: Mastering long-running processes in modern architectures
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptxMerck Moving Beyond Passwords: FIDO Paris Seminar.pptx
Merck Moving Beyond Passwords: FIDO Paris Seminar.pptx
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
Moving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdfMoving Beyond Passwords: FIDO Paris Seminar.pdf
Moving Beyond Passwords: FIDO Paris Seminar.pdf
 
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyesHow to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
How to Effectively Monitor SD-WAN and SASE Environments with ThousandEyes
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 

2014 akka-streams-tokyo-japanese

  • 1. Konrad 'ktoso' Malawski GeeCON 2014 @ Kraków, PL Akka Streams Konrad `@ktosopl` Malawski Tokyo Scala User Group @ Tokyo 2014
  • 3. hAkker @ Konrad `@ktosopl` Malawski typesafe.com geecon.org Java.pl / KrakowScala.pl sckrk.com / meetup.com/Paper-Cup @ London GDGKrakow.pl meetup.com/Lambda-Lounge-Krakow
  • 7. You? ? z ? ?
  • 8. You? ? z ? ? ?
  • 11. Streams “You cannot enter the same river twice” ~ Heraclitus http://en.wikiquote.org/wiki/Heraclitus
  • 12. Streams ライルタイムストリーム処理 Real Time Stream Processing !パブリッシャーにつけることが遅ければ、 データは川のように流れるため、最初の 要素を逃がしてしまう可能性がある When you attach “late” to a Publisher, you may miss initial elements – it’s a river of data. http://en.wikiquote.org/wiki/Heraclitus
  • 14. Reactive Streams ! ! Stream processing
  • 15. Reactive Streams Back-pressured ! Stream processing
  • 16. Reactive Streams Back-pressured Asynchronous Stream processing
  • 17. Reactive Streams Back-pressured Asynchronous Stream processing Standardised (!)
  • 18. Reactive Streams: Goals 1. Back-pressured Asynchronous Stream processing ! 2. Standard implemented by many libraries
  • 19. Reactive Streams - Specification & TCK http://reactive-streams.org
  • 20. Reactive Streams - Who? Kaazing Corp. rxJava @ Netflix, reactor @ Pivotal (SpringSource), vert.x @ Red Hat, Twitter, akka-streams @ Typesafe, spray @ Spray.io, Oracle, java (?) – Doug Lea - SUNY Oswego … http://reactive-streams.org
  • 21. Reactive Streams - Inter-op システム達を協力させたい. We want to make different implementations co-operate with each other. http://reactive-streams.org
  • 22. Reactive Streams - Inter-op リアクティブストリームのプロトコールを 使ってシステム達を話し合わせる The different implementations “talk to each other” using the Reactive Streams protocol. http://reactive-streams.org
  • 23. Reactive Streams - Inter-op リアクティブストリームSPIはユーザーAPIではない。 対象システムのライブラリを使うべき。 The Reactive Streams SPI is NOT meant to be user-api. You should use one of the implementing libraries. http://reactive-streams.org
  • 25. Back-pressure? Example Without Publisher[T] Subscriber[T]
  • 26. Back-pressure? Example Without 速度が早いパブリッシャー Fast Publisher 速度が遅いサブスクライバー Slow Subscriber
  • 27. Back-pressure? Push + NACK model
  • 28. Back-pressure? Push + NACK model
  • 29. Back-pressure? Push + NACK model 通常の場合、サブスクライバーはバッファーがある. Subscriber usually has some kind of buffer.
  • 30. Back-pressure? Push + NACK model
  • 31. Back-pressure? Push + NACK model
  • 32. Back-pressure? Push + NACK model バッファーが溢れてしまった場合、どうなる? What if the buffer overflows?
  • 33. Back-pressure? Push + NACK model (a) 有界バッファーを利用して、溢れてしまったメッセージを 落とし、再送を求める. ! Use bounded buffer, drop messages + require re-sending
  • 34. Back-pressure? Push + NACK model (a) 有界バッファーを利用して、溢れてしまったメッセージを 落とし、再送を求める. ! Use bounded buffer, drop messages + require re-sending Kernel does this! Routers do this! (TCP)
  • 35. Back-pressure? Push + NACK model (b) バッファーの容量を増やす・・・まぁ、 メモリ容量がある限り! Increase buffer size… Well, while you have memory available!
  • 36. Back-pressure? Push + NACK model (b)
  • 37. Back-pressure? Why NACKing is NOT enough
  • 38. Back-pressure? Example NACKing たいへんですよ! バッファーが溢れるまで間もなく! Buffer overflow is imminent!
  • 39. Back-pressure? Example NACKing データを送る速力を落とす、または送信を停止する、 ようにパブリッシャーに告げる. Telling the Publisher to slow down / stop sending…
  • 40. Back-pressure? Example NACKing メッセージが送信されている最中のため、 NACKが間に合わなかった! NACK did not make it in time, because M was in-flight!
  • 41. Back-pressure? ! パブリッシャーの速度 < サブスクライバーの速度 speed(publisher) < speed(subscriber)
  • 42. Back-pressure? Fast Subscriber, No Problem 速度が速いサブスクライバーなら、問題ない! No problem!
  • 43. Back-pressure? Reactive-Streams = “Dynamic Push/Pull”
  • 44. Back-pressure? RS: Dynamic Push/Pull プッシュ一方 - 速度が遅いサブスクライバーの場合、 安全じゃない Just push – not safe when Slow Subscriber ! ! プル一方 - 速度早いサブスクライバーの場合、 遅すぎる Just pull – too slow when Fast Subscriber
  • 45. Back-pressure? RS: Dynamic Push/Pull プッシュ一方 - 速度が遅いサブスクライバーの場合、 安全じゃない Just push – not safe when Slow Subscriber ! ! プル一方 - 速度早いサブスクライバーの場合、 遅すぎる Just pull – too slow when Fast Subscriber ! Solution: 動的な調整(リアクティブストリーム) Dynamic adjustment (Reactive Streams)
  • 46. Back-pressure? RS: Dynamic Push/Pull 速度が遅いサブスクライバーは自分のバッ ファーが3つの要素まで受け取られる。パブリッ シャーはサブスクライバーのバッファーが溢れ るほどデータを送らない。Slow Subscriber sees it’s buffer can take 3 elements. Publisher will never blow up it’s buffer.
  • 47. Back-pressure? RS: Dynamic Push/Pull 速度が速いパブリッシャーは最大でも3つの要 素を送る。これは、プル型のback-pressure. Fast Publisher will send at-most 3 elements. This is pull-based-backpressure.
  • 48. Back-pressure? RS: Dynamic Push/Pull 速度が速いサブスクライバーは、実際のデータ が届く前に、たくさんリクエストを送ることが できる!Fast Subscriber can issue more Request(n), before more data arrives!
  • 49. Back-pressure? RS: Dynamic Push/Pull パブリッシャーはサブスクライバーの全てのリ クエストを溜める. Fast Subscriber can issue more Request(n), before more data arrives. Publisher can accumulate demand.
  • 50. Back-pressure? RS: Accumulate demand パブリッシャーはサブスクライバーの全ての リクエストを溜める. Publisher accumulates total demand per subscriber.
  • 51. Back-pressure? RS: Accumulate demand 溜まった要素をパブリッシュすることは安全だ。 サブスクライバーのバッファーは溢れない。 Total demand of elements is safe to publish. Subscriber’s buffer will not overflow.
  • 52. Back-pressure? RS: Requesting “a lot” 速度が速いサブスクライバーは、パブリッ シャーに対し要求が多くても良い。これは「パ ブリッシャー・プッシュ」だ。バッファー容量 は知られているので、安全だ。
  • 53. Back-pressure? RS: Requesting “a lot” Fast Subscriber, can request “a lot” from Publisher. This is effectively “publisher push”, and is really fast. Buffer size is known and this is safe.
  • 54. Back-pressure? RS: Dynamic Push/Pull MAX速度
  • 55. Back-pressure? RS: Dynamic Push/Pull 安全!溢れ ること絶対 ない! MAX速度
  • 57. Akka = アッカ Akka is a high-performance concurrency library for Scala and Java. ! At it’s core it focuses on the Actor Model:
  • 58. Akka = アッカ Akka is a high-performance concurrency library for Scala and Java. ! At it’s core it focuses on the Actor Model: アクターができること: • メッセージを送信・受信する (Send / receive messages) • アクターを作る (Create Actors) • 自分の動作を変える (Change it’s behaviour)
  • 59. Akka Akka has multiple modules: ! Akka-camel: integration Akka-remote: remote actors Akka-cluster: clustering Akka-persistence: CQRS / Event Sourcing Akka-streams: stream processing …
  • 60. Akka Streams 0.7 early preview
  • 61. Akka Streams – Linear Flow
  • 62. Akka Streams – Linear Flow
  • 63. Akka Streams – Linear Flow
  • 64. Akka Streams – Linear Flow
  • 65. Akka Streams – Linear Flow FlowFrom[Double].map(_.toInt). [...] ソースはまだ付けられていない. パイプはダブルを処理する準備を整いた. No Source attached yet. “Pipe ready to work with Doubles”.
  • 66. Akka Streams – Linear Flow implicit val sys = ActorSystem("tokyo-sys")! ! アクターが住んでいる世界. AkkaStreamsはアクターを使うため、 アクターシステムは必要. ! ActorSystem is the world in which Actors live in. AkkaStreams uses Actors, so it needs ActorSystem.
  • 67. Akka Streams – Linear Flow implicit val sys = ActorSystem("tokyo-sys")! implicit val mat = FlowMaterializer()! ストリームをどうやって具体化するかの ロジックが含まれている. ! Contains logic on HOW to materialise the stream.
  • 68. Akka Streams – Linear Flow implicit val sys = ActorSystem("tokyo-sys")! implicit val mat = FlowMaterializer()! 単純にアクターか、 もしくは実装されていれば、 Apache Spark (?!) ! A materialiser can choose HOW to materialise, it could even use Apache Spark (?!) if someone would implement that… :-)
  • 69. Akka Streams – Linear Flow implicit val sys = ActorSystem("tokyo-sys")! implicit val mat = FlowMaterializer()! バッファーの容量を設定できるなど ! You can configure it’s buffer sizes etc.
  • 70. Akka Streams – Linear Flow implicit val sys = ActorSystem("tokyo-sys")! implicit val mat = FlowMaterializer()! val foreachSink = ForeachSink[Int](println)! val mf = FlowFrom(1 to 3).withSink(foreachSink).run() Uses the implicit FlowMaterializer
  • 71. Akka Streams – Linear Flow implicit val sys = ActorSystem("tokyo-sys")! implicit val mat = FlowMaterializer()! val foreachSink = ForeachSink[Int](println)! val mf = FlowFrom(1 to 3).withSink(foreachSink).run()(mat)
  • 72. Akka Streams – Linear Flow val mf = FlowFrom[Int].! map(_ * 2).! withSink(ForeachSink(println)) // needs source,! // can NOT run 走らせるためにソースが必要!
  • 73. Akka Streams – Linear Flow val f = FlowFrom[Int].! map(_ * 2).! ! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! ! ! // needs Source to run! インプットが必要 走らせるためにソースが必要!
  • 74. Akka Streams – Linear Flow val f = FlowFrom[Int].! map(_ * 2).! ! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! ! ! // needs Source to run!
  • 75. Akka Streams – Linear Flow val f = FlowFrom[Int].! map(_ * 2).! ! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! ! ! // needs Source to run!
  • 76. Akka Streams – Linear Flow val f = FlowFrom[Int].! map(_ * 2).! ! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! ! ! // needs Source to run! ! ! ! ! f.withSource(IterableSource(1 to 10)).run() 準備完了!
  • 77. Akka Streams – Linear Flow val f = FlowFrom[Int].! map(_ * 2).! ! ! ! withSink(ForeachSink(i => println(s"i = $i”))).! ! ! // needs Source to run! ! ! ! ! f.withSource(IterableSource(1 to 10)).run() 準備完了!
  • 78. Akka Streams – Flows are reusable ! ! ! ! f.withSource(IterableSource(1 to 10)).run()! ! ! ! f.withSource(IterableSource(1 to 100)).run()! ! ! ! f.withSource(IterableSource(1 to 1000)).run()
  • 79. Akka Streams <-> Actors – Advanced val subscriber = system.actorOf(Props[SubStreamParent], ”parent")! ! FlowFrom(1 to 100).! map(_.toString).! filter(_.length == 2).! drop(2).! groupBy(_.last).! publishTo(ActorSubscriber(subscriber))!
  • 80. Akka Streams <-> Actors – Advanced val subscriber = system.actorOf(Props[SubStreamParent], ”parent")! ! FlowFrom(1 to 100).! map(_.toString).! filter(_.length == 2).! drop(2).! groupBy(_.last).! publishTo(ActorSubscriber(subscriber))! 各グループもストリームだよ! Each “group” is a stream too! It’s a “Stream of Streams”.
  • 81. Akka Streams <-> Actors – Advanced ! groupBy(_.last). 「11」をグループ「1」に、「12」をグループ「2」になど GroupBy groups “11” to group “1”, “12” to group “2” etc.
  • 82. Akka Streams <-> Actors – Advanced ! groupBy(_.last). サブスクライバーに[グループキー、サブストリームフロー]を提供する It offers (groupKey, subStreamFlow) to Subscriber
  • 83. Akka Streams <-> Actors – Advanced ! groupBy(_.last). 子供を起動させ、サブーフローを扱わせる It can then start children, to handle the sub-flows!
  • 84. Akka Streams <-> Actors – Advanced ! groupBy(_.last). 例えば、グループ毎に1人の子供 For example, one child for each group.
  • 85. Akka Streams <-> Actors – Advanced val subscriber = system.actorOf(Props[SubStreamParent], ”parent")! ! FlowFrom(1 to 100).! map(_.toString).! filter(_.length == 2).! drop(2).! groupBy(_.last).! publishTo(ActorSubscriber(subscriber))! 普通 Akka Actor, will consume SubStream offers.
  • 86. Akka Streams <-> Actors – Advanced class SubStreamParent extends ActorSubscriber ! with ImplicitFlowMaterializer ! with ActorLogging {! ! override def requestStrategy = OneByOneRequestStrategy! ! override def receive = {! case OnNext((groupId: String, subStream: FlowWithSource[_, _])) =>! ! val subSub = context.actorOf(Props[SubStreamSubscriber], ! s"sub-$groupId")! subStream.publishTo(ActorSubscriber(subSub))! }! }!
  • 87. Akka Streams <-> Actors – Advanced class SubStreamParent extends ActorSubscriber ! with ImplicitFlowMaterializer ! with ActorLogging {! ! override def requestStrategy = OneByOneRequestStrategy! ! override def receive = {! case OnNext((groupId: String, subStream: FlowWithSource[_, _])) =>! ! val subSub = context.actorOf(Props[SubStreamSubscriber], ! s"sub-$groupId")! subStream.publishTo(ActorSubscriber(subSub))! }! }!
  • 88. Akka Streams <-> Actors – Advanced class SubStreamParent extends ActorSubscriber ! with ImplicitFlowMaterializer ! with ActorLogging {! ! override def requestStrategy = OneByOneRequestStrategy! ! override def receive = {! case OnNext((groupId: String, subStream: FlowWithSource[_, _])) =>! ! val subSub = context.actorOf(Props[SubStreamSubscriber], ! s"sub-$groupId")! subStream.publishTo(ActorSubscriber(subSub))! }! }!
  • 89. Akka Streams <-> Actors – Advanced class SubStreamParent extends ActorSubscriber ! with ImplicitFlowMaterializer ! with ActorLogging {! ! override def requestStrategy = OneByOneRequestStrategy! ! override def receive = {! case OnNext((groupId: String, subStream: FlowWithSource[_, _])) =>! ! val subSub = context.actorOf(Props[SubStreamSubscriber], ! s"sub-$groupId")! subStream.publishTo(ActorSubscriber(subSub))! }! }!
  • 90. Akka Streams <-> Actors – Advanced class SubStreamParent extends ActorSubscriber ! with ImplicitFlowMaterializer ! with ActorLogging {! ! override def requestStrategy = OneByOneRequestStrategy! ! override def receive = {! case OnNext((groupId: String, subStream: FlowWithSource[_, _])) =>! ! val subSub = context.actorOf(Props[SubStreamSubscriber], ! s"sub-$groupId")! subStream.publishTo(ActorSubscriber(subSub))! }! }!
  • 91. Akka Streams <-> Actors – Advanced class SubStreamParent extends ActorSubscriber {! ! override def requestStrategy = OneByOneRequestStrategy! ! override def receive = {! case OnNext(n: String) => println(s”n = $n”) ! }! }!
  • 92. Akka Streams – GraphFlow GraphFlow
  • 93. Akka Streams – GraphFlow Linear Flows or non-akka pipelines Could be another RS implementation!
  • 94. Akka Streams – GraphFlow Fan-out elements and Fan-in elements
  • 95. Akka Streams – GraphFlow Fan-out elements and Fan-in elements Now you need a FlowGraph
  • 96. Akka Streams – GraphFlow // first define some pipeline pieces! val f1 = FlowFrom[Input].map(_.toIntermediate)! val f2 = FlowFrom[Intermediate].map(_.enrich)! val f3 = FlowFrom[Enriched].filter(_.isImportant)! val f4 = FlowFrom[Intermediate].mapFuture(_.enrichAsync)! ! // then add input and output placeholders! val in = SubscriberSource[Input]! val out = PublisherSink[Enriched]!
  • 97. Akka Streams – GraphFlow
  • 98. Akka Streams – GraphFlow val b3 = Broadcast[Int]("b3")! val b7 = Broadcast[Int]("b7")! val b11 = Broadcast[Int]("b11")! val m8 = Merge[Int]("m8")! val m9 = Merge[Int]("m9")! val m10 = Merge[Int]("m10")! val m11 = Merge[Int]("m11")! val in3 = IterableSource(List(3))! val in5 = IterableSource(List(5))! val in7 = IterableSource(List(7))!
  • 99. Akka Streams – GraphFlow
  • 100. Akka Streams – GraphFlow // First layer! in7 ~> b7! b7 ~> m11! b7 ~> m8! ! in5 ~> m11! ! in3 ~> b3! b3 ~> m8! b3 ~> m10!
  • 101. Akka Streams – GraphFlow ! // Second layer! m11 ~> b11! b11 ~> FlowFrom[Int].grouped(1000) ~> resultFuture2 ! b11 ~> m9! b11 ~> m10! ! m8 ~> m9!
  • 102. Akka Streams – GraphFlow ! // Third layer! m9 ~> FlowFrom[Int].grouped(1000) ~> resultFuture9! m10 ~> FlowFrom[Int].grouped(1000) ~> resultFuture10!
  • 103. Akka Streams – GraphFlow ! // Third layer! m9 ~> FlowFrom[Int].grouped(1000) ~> resultFuture9! m10 ~> FlowFrom[Int].grouped(1000) ~> resultFuture10!
  • 104. Akka Streams – GraphFlow ! // Third layer! m9 ~> FlowFrom[Int].grouped(1000) ~> resultFuture9! m10 ~> FlowFrom[Int].grouped(1000) ~> resultFuture10!
  • 105. Akka Streams – GraphFlow Sinks and Sources are “keys” which can be addressed within the graph val resultFuture2 = FutureSink[Seq[Int]]! val resultFuture9 = FutureSink[Seq[Int]]! val resultFuture10 = FutureSink[Seq[Int]]! ! val g = FlowGraph { implicit b =>! // ...! m10 ~> FlowFrom[Int].grouped(1000) ~> resultFuture10! // ...! }.run()! ! Await.result(g.getSinkFor(resultFuture2), 3.seconds).sorted! should be(List(5, 7))
  • 106. Akka Streams – GraphFlow Sinks and Sources are “keys” which can be addressed within the graph val resultFuture2 = FutureSink[Seq[Int]]! val resultFuture9 = FutureSink[Seq[Int]]! val resultFuture10 = FutureSink[Seq[Int]]! ! val g = FlowGraph { implicit b =>! // ...! m10 ~> FlowFrom[Int].grouped(1000) ~> resultFuture10! // ...! }.run()! ! Await.result(g.getSinkFor(resultFuture2), 3.seconds).sorted! should be(List(5, 7))
  • 107. Akka Streams – GraphFlow ! val g = FlowGraph {}! FlowGraphは不変で、安全に共有でき、 何度も使いまわせる! ! FlowGraph is immutable and safe to share and re-use! Think of it as “the description” which then gets “run”.
  • 108. Available Elements 0.7 early preview
  • 109. Available Sources • FutureSource • IterableSource • IteratorSource • PublisherSource • SubscriberSource • ThunkSource • TickSource (timer based) • 簡単に自分のものを追加できる! … easy to add your own! 0.7 early preview
  • 110. Available operations • buffer • collect • concat • conflate • drop / dropWithin • take / takeWithin • filter • fold • foreach • groupBy • grouped • map • onComplete • prefixAndTail • broadcast • merge / “generalised merge” • zip • 自分のオペレーションを追加する事は可能! … possible to add your own! 0.7 early preview
  • 111. Available Sinks • BlackHoleSink • FoldSink • ForeachSink • FutureSink • OnCompleteSink • PublisherSink / FanoutPublisherSink • SubscriberSink • 簡単に自分のものを追加できる! … easy to add your own! 0.7 early preview
  • 112. Spray => Akka-Http && ReactiveStreams Spray is now merged into Akka, as Akka-Http Works on Reactive Streams Streaming end-to-end!
  • 113. Links • http://akka.io • http://reactive-streams.org • https://groups.google.com/group/akka-user <- ask questions here! • http://akka.io/news/2014/09/12/akka-streams-0.7-released.html
  • 114. ありがとう ございました! Ask questions, get Stickers! http://akka.io ktoso @ typesafe.com twitter: ktosopl github: ktoso team blog: letitcrash.com
  • 115. ©Typesafe 2014 – All Rights Reserved