SlideShare a Scribd company logo
1 of 105
Download to read offline
Reactive 
Streams
Reactive 
Streams 
THEN 
Java Developer 
LATER 
Enterprise 
Architect 
NOW 
Scala Consultant 
TWITTER 
@slavaschmidt 
MAIL 
slavaschmidt@gmx.de
Stream
Java 5/6/7 
A stream can be defined as a sequence of 
data. 
A powerful concept that greatly simplifies I/O 
operations.
Java 8 
A sequence of elements supporting 
sequential and parallel aggregate 
operations.
•sequence of data or instructions 
•hot or cold 
•bounded or unbounded 
•focus on data transfer and/or transformation
Uses
•bulk data transfer 
•batch processing of large data sets 
•micro-batching 
•real-time data sources 
•embedded data-processing 
•monitoring and analytics 
•metrics, statistics composition 
•event processing 
•error handling
MEET 
ALICE AND BORIS
MEET 
ALICE AND BORIS
Java 6
Java 7
Java 8
NAK (NACK)
Backpressure
Reactive Stream
MEET 
ALICE AND BORIS 
•Typical threads 
•Do some work 
•Exchange data
Direct Calls 
private static final SThread alice = 
new SThread("RS-Alice") { 
@Override public void swap(int count) { 
super.swap(count); 
borice.swap(count); 
} 
}; 
private static final SThread borice = 
new SThread("RS-Borice") { 
@Override public void run() { 
while (!stopped()) { SwapEnvironment.work(); } 
} 
@Override public void swap(int count) { 
super.swap(count); 
} 
};
Java IO 
“Let’s move some data”
Java IO 
A PipedOutputStream 
PipedInputStream 
protected byte buffer[]; 
B
Java IO 
A PipedOutputStream PipedInputStream B 
protected byte buffer[];
Java IO 
A PipedOutputStream PipedInputStream B 
Write 
Block 
Transfer 
Block 
Read 
Block
Java IO 
val alice = new SThread("RS-Alice") { 
override def swap(n: Int) { 
val out = new PipedOutputStream() 
val in = new PipedInputStream(out, size) 
super.swap(n) 
for (i <- 0 to n * rateA) out.write(Env.BEER) 
} 
} 
val borice = new SThread("RS-Borice") { 
override def swap(n: Int) { 
super.swap(n) 
for (i <- 0 to n * rateB) in.read() 
} 
}
Java IO 
val alice = new SThread("RS-Alice") { 
override def swap(n: Int) { 
val out = new PipedOutputStream() 
val in = new PipedInputStream(out, size) 
super.swap(n) 
for (i <- 0 to n * rateA) out.write(Env.BEER) 
} 
} 
INCREASE 
val borice = new SThread("RS-Borice") { 
override def swap(n: Int) { 
super.swap(n) 
for (i <- 0 to n * rateB) in.read() 
} 
}
Java IO 
val alice = new SThread("RS-Alice") { 
override def swap(n: Int) { 
val out = new PipedOutputStream() 
val in = new PipedInputStream(out, size) 
super.swap(n) 
for (i <- 0 to n * rateA) out.write(Env.BEER) 
} 
} 
INCREASE 
val borice = new SThread("RS-Borice") { 
override def swap(n: Int) { 
super.swap(n) 
for (i <- 0 to n * rateB) in.read() 
} 
}
Java IO 
val alice = new SThread("RS-Alice") { 
override def swap(n: Int) { 
val out = new PipedOutputStream() 
val in = new PipedInputStream(out, size) 
super.swap(n) 
for (i <- 0 to n * rateA) out.write(Env.BEER) 
} 
} 
val borice = new SThread("RS-Borice") { 
override def swap(n: Int) { 
super.swap(n) 
for (i <- 0 to n * rateB) in.read() 
} 
} 
INCREASE
Java IO 
Blocking is only a matter of time :(
Java NIO 
“There is a better way”
Java NIO 
A Buffer SinkChannel SourceChannel Buffer 
B 
Write 
Block 
Transfer 
Read 
Block 
Read 
Fill
Java NIO 
val alice = new SThread("RS-Alice") { 
override def swap(n: Int) { 
val cnt = n * rateA 
val buffer = ByteBuffer.allocate(cnt) 
buffer.put(Vector.fill(cnt)(BEER).toArray) 
buffer.flip() 
val written = sinkChannel.write(buffer) 
super.swap(written) 
} 
} 
val pipe = Pipe.open() 
val sinkChannel = pipe.sink 
val sourceChannel = pipe.source 
sourceChannel.configureBlocking(true) 
sinkChannel.configureBlocking(false) 
BLOCKING 
val borice = new SThread("RS-Borice") { 
override def swap(n: Int) { 
val buffer = ByteBuffer.allocate(n * rateB) 
val cnt = sourceChannel.read(buffer) 
super.swap(cnt) 
} 
}
Java NIO 
val alice = new SThread("RS-Alice") { 
override def swap(n: Int) { 
val cnt = n * rateA 
val buffer = ByteBuffer.allocate(cnt) 
buffer.put(Vector.fill(cnt)(BEER).toArray) 
buffer.flip() 
val written = sinkChannel.write(buffer) 
super.swap(written) 
} 
} 
val pipe = Pipe.open() 
val sinkChannel = pipe.sink 
val sourceChannel = pipe.source 
sourceChannel.configureBlocking(false) 
sinkChannel.configureBlocking(false) 
NON-BLOCKING 
val borice = new SThread("RS-Borice") { 
override def swap(n: Int) { 
val buffer = ByteBuffer.allocate(n * rateB) 
val cnt = sourceChannel.read(buffer) 
super.swap(cnt) 
} 
}
Java NIO 
“Choose how to fail”
IO & NIO
IO & NIO 
Blocking 
or 
Dropping 
or 
Unbounded 
Scalability 
Non-Determinism 
OutOfMemory
Solution 
Backpressure
Solution 
Backpressure 
Dynamic Push/Pull 
Fast Boris
Solution 
Backpressure 
Dynamic Push/Pull 
Fast Alice
Backpressure 
A Stream B 
Demand 
Data 
Demand 
Data
Java 8
Java 8 
public class ConsumerBorice extends SThread implements Consumer<byte[]> { 
public ConsumerBorice(String name) { 
super(name); 
} 
@Override 
public Consumer andThen(Consumer after) { 
return after; 
} 
@Override 
public void accept(byte[] bytes) { 
super.swap(bytes.length); 
} 
}
Java 8 
private static final ConsumerBorice borice = 
new ConsumerBorice("RS-Borice") { 
public void swap(int count) { } 
}; 
private static final SThread alice = new SThread ("RS-Alice") { 
byte[] items(int count) { 
byte[] result = new byte[count]; 
Arrays.fill(result, Env.BEER()); 
return result; 
} 
public void swap(int count) { 
Stream.of(items(count)).parallel() 
.filter(s -> s.equals(Env.BEER())) 
.forEach(borice); 
super.swap(count); 
} 
};
Java 8 
private static final ConsumerBorice borice = 
new ConsumerBorice("RS-Borice") { 
public void swap(int count) { } 
}; 
private static final SThread alice = new SThread ("RS-Alice") { 
byte[] items(int count) { 
byte[] result = new byte[count]; 
Arrays.fill(result, Env.BEER()); 
return result; 
} 
public void swap(int count) { 
Stream.of(items(count)).parallel() 
.filter(s -> s.equals(Env.BEER())) 
.forEach(borice); 
super.swap(count); 
} 
}; 
transformation 
static push (or pull) 
or sequential
Java 8 
private static final ConsumerBorice borice = 
new ConsumerBorice("RS-Borice") { 
public void swap(int count) { } 
}; 
private static final SThread alice = new SThread ("RS-Alice") { 
byte[] items(int count) { 
byte[] result = new byte[count]; 
Arrays.fill(result, Env.BEER()); 
return result; 
} 
public void swap(int count) { 
Stream.of(items(count)).parallel() 
.filter(s -> s.equals(Env.BEER())) 
.forEach(borice); 
super.swap(count); 
} 
Synchronous 
}; Non-Deterministic 
Limited Scalable 
Terminates on error
Problems 
Synchronous 
Non-Deterministic 
Limited Scalable 
Terminates on error
Problems 
Non-Deterministic 
Limited Scalable Terminates on error 
Synchronous
Responsive 
Elastic Resilient 
Message Driven
Reactive 
Responsive 
Elastic Resilient 
Message Driven 
http://www.reactivemanifesto.org
Reactive Streams 
… a standard for 
asynchronous stream 
processing with non-blocking 
backpressure. 
http://www.reactive-streams.org
Participants 
Netflix rxJava, rxScala, … 
Oracle 
Pivotal Spring Reactor 
RedHat Vert.x 
Twitter 
Typesafe Akka Streams 
Ratpack
Reactive Streams 
• Semantics (Specification) 
• API (Application Programming Interface) 
• TCK (Technology Compatibility Kit)
API 
public interface Publisher<T> { 
void subscribe(Subscriber<? super T> var1); 
} 
public interface Subscriber<T> { 
void onSubscribe(Subscription var1); 
void onNext(T var1); 
void onError(Throwable var1); 
void onComplete(); 
} 
public interface Subscription { 
void request(long var1); 
void cancel(); 
}
Subscription 
Producer Subscriber 
subscribe 
Subscription 
onSubscribe
Streaming 
request 
Subscription 
onNext 
onComplete 
onError 
cancel 
Subscriber
Publisher 
trait BytePublisher extends Publisher[Byte] { 
var subscriber: Subscriber[_ >: Byte] = _ 
override def subscribe(subscriber: Subscriber[_ >: Byte]) { 
this.subscriber = subscriber 
} 
} 
val alice = new SThread("RS-Alice") with BytePublisher { 
override def swap(n: Int) { 
for { i <- 1 to n } subscriber.onNext(Env.BEER) 
super.swap(n) 
} 
}
Subscriber 
trait ByteSubscriber[T >: Byte] extends Subscriber[T] { 
var subscription: Subscription = _ 
override def onSubscribe(subscription: Subscription) { 
this.subscription = subscription 
} 
override def onError(t: Throwable) { } 
override def onComplete() { } 
} 
val borice = new SThread(“RS-Borice") with ByteSubscriber[Byte]{ 
def onNext(t: Byte) { 
super.swap(1) 
} 
}
Right Subscriber 
val borice = new SThread(“RS-Borice") with ByteSubscriber[Byte]{ 
alice.subscribe(this) 
override def swap(n: Int) { 
subscription.request(n) 
} 
def onNext(t: Byte) { 
super.swap(1) 
} 
}
Right Publisher 
trait BytePublisher extends Publisher[Byte] { 
var subscriber: Subscriber[_ >: Byte] = _ 
var subscription: Subscription = _ 
val counter = new AtomicInteger(0) 
def request(l: Long): Unit = { 
counter.addAndGet(l.toInt) 
} 
override def subscribe(subscriber: Subscriber[_ >: Byte]) { 
this.subscription = new ByteSub(this) 
this.subscriber = subscriber 
subscriber.onSubscribe(this.subscription) 
} 
} 
val alice = new SThread("RS-Alice") with BytePublisher { 
override def swap(n: Int) { 
val cnt = math.min(n, counter.get()) 
counter.addAndGet(-cnt) 
for { i <- 1 to cnt } subscriber.onNext(Env.BEER) 
super.swap(n) 
} 
}
Akka Streams 
implicit val mat = FlowMaterializer()(system) 
Source(alice).runWith(Sink(borice))
Reactor Stream 
Streams.create(alice).subscribe(borice)
Ratpack.io 
ratpack.stream.Streams.buffer(alice).subscribe(borice)
RxReactiveStreams 
import rx.RxReactiveStreams._ 
subscribe(toObservable(alice), borice)
Vert.X 
//vert.x 3.0 - only supports Streams[Buffer] 
val rws = ReactiveWriteStream.writeStream() 
rws.subscribe(borice) 
val rrs = ReactiveReadStream.readStream() 
alice.subscribe(rrs) 
val pump = Pump.pump(rrs, rws) 
pump.start()
Why 
should 
I care?
Because 
•Simplifies reactive programming 
•Rises program’s abstraction level 
•May be future JDK standard
Abstraction levels
Abstraction levels 
Runnable & Thread
Abstraction levels 
java.util.concurrent
Abstraction levels 
Promise & Future
Abstraction levels 
Actors
Abstraction levels 
Streams
Abstraction levels
Interoperability
Shop Admin 
ADs Stats 
Delivery 
WebShop 
Merchant
Shop Admin 
DB 
ADs Stats 
Delivery 
WebShop 
Merchant 
REST 
File System 
Messaging 
REST
Shop Admin 
(vert.x) 
Delivery 
(Spring) 
WebShop 
(ratpack.io) 
Merchant 
(Akka) 
ADs 
(Rx…) 
Stats 
(Spray) 
DB 
REST 
File System 
Messaging 
REST
Shop Admin 
(vert.x) 
Delivery 
(Spring) 
WebShop 
(ratpack.io) 
Merchant 
(Akka) 
ADs 
(Rx…) 
Stats 
(Spray) 
DB
Shop Admin 
(vert.x) 
Data Flow 
Backpressure 
Delivery 
(Spring) 
WebShop 
(ratpack.io) 
Merchant 
(Akka) 
ADs 
(Rx…) 
Stats 
(Spray) 
DB
Example Akka
Example Akka
Example Akka 
val display = { 
def ellipse (i: Input) = setColor(i).fillOval(i(3), i(4), i(5), i(6)) 
def rect (i: Input) = setColor(i).fillRect(i(3), i(4), i(5), i(6)) 
val logics: Seq[(Input) => Unit] = Seq(ellipse, rect) 
def rnd = Random.nextInt(255) 
val timer = Source(0.seconds, 1.second, () => rnd ) 
val randoms = Source { () => Some(rnd) } 
val functions = timer map { i => logics(i % logics.size) } 
val display = functions map { f => 
val groups = randoms.take(7) 
val params = groups.fold(List.empty[Int])((l, i) => i :: l) 
for { p <- params } f(p) 
} 
display 
} 
def start = { 
display.runWith(BlackholeSink) 
}
Use Case 
Price Correction 
System
Product schedules 
Competitors 
Volatile sources 
Audit 
Historical trends 
Alerts 
Sales Heuristics 
Pricing Rules 
Adjustments
Timer Scheduler 
Competitors 
Volatile sources 
Audit 
Historical trends 
Alerts 
Sales Heuristics 
Pricing Rules 
Adjustments
Timer Scheduler Robots 
Volatile sources 
Audit 
Historical trends 
Alerts 
Sales Heuristics 
Pricing Rules 
Adjustments
Timer Scheduler Robots 
Audit 
Historical trends 
Alerts 
Sales Heuristics 
Pricing Rules 
Adjustments 
Validators
Timer Scheduler Robots 
Historical trends 
Alerts 
Sales Heuristics 
Pricing Rules 
Adjustments 
Logger Validators
Timer Scheduler Robots 
Stock Logger Validators 
Historical trends 
Pricing Rules 
Alerts 
Adjustments
Timer Scheduler Robots 
Stock Logger Validators 
Pricing 
Historical trends 
Alerts 
Adjustments
Timer Scheduler Robots 
Stock Logger Validators 
Historical trends 
Alerts 
Pricing Ruler
Timer Scheduler Robots 
Stock Logger Validators 
Pricing Ruler Safety 
Historical trends
Timer Scheduler Robots 
Stock Logger Validators 
Pricing Ruler Safety 
Archive
Timer Scheduler 
Validators 
Stock 
Logger 
Robots 
Pricing 
Archive 
Safety Ruler 
Data Flow 
Backpressure
val schedules = Flow[Date] mapConcat generateSchedules 
val robots = Flow[Schedule] map scrape 
val validations = Flow[ScrapeResult] map { site => 
logSite(site) 
validate(site) 
} 
val pricing = Flow[Validation] map checkPrice 
val stock = Flow[Validation] map checkStock 
val ruler = Flow[(Price, Stock)] map applyRule 
val safety = Flow[Rule] map checkSafety 
val zip = Zip[Price, Stock] 
val split = Broadcast[Validation]
Timer Scheduler 
Validators 
Stock 
Logger 
Robots 
Pricing 
Archive 
Safety Ruler 
Data Flow 
Backpressure
val timer = Source(0.seconds, 1.minute, () => now) 
val archive = ForeachSink[SafetyCheck] { logRule } 
val graph = FlowGraph { implicit builder => 
timer ~> schedules ~> robots ~> validations ~> split 
split ~> stock ~> zip.right 
split ~> pricing ~> zip.left ~> ruler ~> safety ~> archive 
} 
graph.run()
24 cores 
48 Gb 
24 cores 
48 Gb 
150 000 000 
positions daily
Reactive Streams
Reactive Streams 
•Simplify reactive programming 
•Rise program’s abstraction level 
•May be future JDK standard
Now I 
care!
Thank you 
@slavaschmidt 
slavaschmidt@gmx.de

More Related Content

What's hot

The Ring programming language version 1.7 book - Part 38 of 196
The Ring programming language version 1.7 book - Part 38 of 196The Ring programming language version 1.7 book - Part 38 of 196
The Ring programming language version 1.7 book - Part 38 of 196Mahmoud Samir Fayed
 
Scalding: Reaching Efficient MapReduce
Scalding: Reaching Efficient MapReduceScalding: Reaching Efficient MapReduce
Scalding: Reaching Efficient MapReduceLivePerson
 
Java8 Neue Sprachfeatures - Lambda/Streams/default Methods/FunctionalInterfaces
Java8 Neue Sprachfeatures - Lambda/Streams/default Methods/FunctionalInterfacesJava8 Neue Sprachfeatures - Lambda/Streams/default Methods/FunctionalInterfaces
Java8 Neue Sprachfeatures - Lambda/Streams/default Methods/FunctionalInterfacesDirk Detering
 
Kamil Chmielewski, Jacek Juraszek - "Hadoop. W poszukiwaniu złotego młotka."
Kamil Chmielewski, Jacek Juraszek - "Hadoop. W poszukiwaniu złotego młotka."Kamil Chmielewski, Jacek Juraszek - "Hadoop. W poszukiwaniu złotego młotka."
Kamil Chmielewski, Jacek Juraszek - "Hadoop. W poszukiwaniu złotego młotka."sjabs
 
ReactiveCocoa and Swift, Better Together
ReactiveCocoa and Swift, Better TogetherReactiveCocoa and Swift, Better Together
ReactiveCocoa and Swift, Better TogetherColin Eberhardt
 
Connect S3 with Kafka using Akka Streams
Connect S3 with Kafka using Akka Streams Connect S3 with Kafka using Akka Streams
Connect S3 with Kafka using Akka Streams Seiya Mizuno
 
Introduction to the New Aggregation Framework
Introduction to the New Aggregation FrameworkIntroduction to the New Aggregation Framework
Introduction to the New Aggregation FrameworkMongoDB
 

What's hot (8)

Rxjs ppt
Rxjs pptRxjs ppt
Rxjs ppt
 
The Ring programming language version 1.7 book - Part 38 of 196
The Ring programming language version 1.7 book - Part 38 of 196The Ring programming language version 1.7 book - Part 38 of 196
The Ring programming language version 1.7 book - Part 38 of 196
 
Scalding: Reaching Efficient MapReduce
Scalding: Reaching Efficient MapReduceScalding: Reaching Efficient MapReduce
Scalding: Reaching Efficient MapReduce
 
Java8 Neue Sprachfeatures - Lambda/Streams/default Methods/FunctionalInterfaces
Java8 Neue Sprachfeatures - Lambda/Streams/default Methods/FunctionalInterfacesJava8 Neue Sprachfeatures - Lambda/Streams/default Methods/FunctionalInterfaces
Java8 Neue Sprachfeatures - Lambda/Streams/default Methods/FunctionalInterfaces
 
Kamil Chmielewski, Jacek Juraszek - "Hadoop. W poszukiwaniu złotego młotka."
Kamil Chmielewski, Jacek Juraszek - "Hadoop. W poszukiwaniu złotego młotka."Kamil Chmielewski, Jacek Juraszek - "Hadoop. W poszukiwaniu złotego młotka."
Kamil Chmielewski, Jacek Juraszek - "Hadoop. W poszukiwaniu złotego młotka."
 
ReactiveCocoa and Swift, Better Together
ReactiveCocoa and Swift, Better TogetherReactiveCocoa and Swift, Better Together
ReactiveCocoa and Swift, Better Together
 
Connect S3 with Kafka using Akka Streams
Connect S3 with Kafka using Akka Streams Connect S3 with Kafka using Akka Streams
Connect S3 with Kafka using Akka Streams
 
Introduction to the New Aggregation Framework
Introduction to the New Aggregation FrameworkIntroduction to the New Aggregation Framework
Introduction to the New Aggregation Framework
 

Viewers also liked

Functional Reactive Programming with RxJS
Functional Reactive Programming with RxJSFunctional Reactive Programming with RxJS
Functional Reactive Programming with RxJSstefanmayer13
 
Functional Reactive Programming With RxSwift
Functional Reactive Programming With RxSwiftFunctional Reactive Programming With RxSwift
Functional Reactive Programming With RxSwift선협 이
 
RxJS and Reactive Programming - Modern Web UI - May 2015
RxJS and Reactive Programming - Modern Web UI - May 2015RxJS and Reactive Programming - Modern Web UI - May 2015
RxJS and Reactive Programming - Modern Web UI - May 2015Ben Lesh
 
NDC14 - Rx와 Functional Reactive Programming으로 고성능 서버 만들기
NDC14 - Rx와 Functional Reactive Programming으로 고성능 서버 만들기NDC14 - Rx와 Functional Reactive Programming으로 고성능 서버 만들기
NDC14 - Rx와 Functional Reactive Programming으로 고성능 서버 만들기Jong Wook Kim
 
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015NAVER / MusicPlatform
 
[1B4]안드로이드 동시성_프로그래밍
[1B4]안드로이드 동시성_프로그래밍[1B4]안드로이드 동시성_프로그래밍
[1B4]안드로이드 동시성_프로그래밍NAVER D2
 

Viewers also liked (6)

Functional Reactive Programming with RxJS
Functional Reactive Programming with RxJSFunctional Reactive Programming with RxJS
Functional Reactive Programming with RxJS
 
Functional Reactive Programming With RxSwift
Functional Reactive Programming With RxSwiftFunctional Reactive Programming With RxSwift
Functional Reactive Programming With RxSwift
 
RxJS and Reactive Programming - Modern Web UI - May 2015
RxJS and Reactive Programming - Modern Web UI - May 2015RxJS and Reactive Programming - Modern Web UI - May 2015
RxJS and Reactive Programming - Modern Web UI - May 2015
 
NDC14 - Rx와 Functional Reactive Programming으로 고성능 서버 만들기
NDC14 - Rx와 Functional Reactive Programming으로 고성능 서버 만들기NDC14 - Rx와 Functional Reactive Programming으로 고성능 서버 만들기
NDC14 - Rx와 Functional Reactive Programming으로 고성능 서버 만들기
 
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
서버 개발자가 바라 본 Functional Reactive Programming with RxJava - SpringCamp2015
 
[1B4]안드로이드 동시성_프로그래밍
[1B4]안드로이드 동시성_프로그래밍[1B4]안드로이드 동시성_프로그래밍
[1B4]안드로이드 동시성_프로그래밍
 

Similar to Java/Scala Lab: Slava Schmidt - Introduction to Reactive Streams

Reactive streams. Slava Schmidt
Reactive streams. Slava SchmidtReactive streams. Slava Schmidt
Reactive streams. Slava SchmidtAlina Dolgikh
 
HBaseConEast2016: HBase and Spark, State of the Art
HBaseConEast2016: HBase and Spark, State of the ArtHBaseConEast2016: HBase and Spark, State of the Art
HBaseConEast2016: HBase and Spark, State of the ArtMichael Stack
 
Basic iOS Training with SWIFT - Part 2
Basic iOS Training with SWIFT - Part 2Basic iOS Training with SWIFT - Part 2
Basic iOS Training with SWIFT - Part 2Manoj Ellappan
 
PSUG #52 Dataflow and simplified reactive programming with Akka-streams
PSUG #52 Dataflow and simplified reactive programming with Akka-streamsPSUG #52 Dataflow and simplified reactive programming with Akka-streams
PSUG #52 Dataflow and simplified reactive programming with Akka-streamsStephane Manciot
 
Intro To Cascading
Intro To CascadingIntro To Cascading
Intro To CascadingNate Murray
 
(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?Tomasz Wrobel
 
SF Scala meet up, lighting talk: SPA -- Scala JDBC wrapper
SF Scala meet up, lighting talk: SPA -- Scala JDBC wrapperSF Scala meet up, lighting talk: SPA -- Scala JDBC wrapper
SF Scala meet up, lighting talk: SPA -- Scala JDBC wrapperChester Chen
 
Meet Up - Spark Stream Processing + Kafka
Meet Up - Spark Stream Processing + KafkaMeet Up - Spark Stream Processing + Kafka
Meet Up - Spark Stream Processing + KafkaKnoldus Inc.
 
Hive Functions Cheat Sheet
Hive Functions Cheat SheetHive Functions Cheat Sheet
Hive Functions Cheat SheetHortonworks
 
HBase Client APIs (for webapps?)
HBase Client APIs (for webapps?)HBase Client APIs (for webapps?)
HBase Client APIs (for webapps?)Nick Dimiduk
 
b. (10 pts) Implement the rotate left method for AVL trees.c. (10 .pdf
b. (10 pts) Implement the rotate left method for AVL trees.c. (10 .pdfb. (10 pts) Implement the rotate left method for AVL trees.c. (10 .pdf
b. (10 pts) Implement the rotate left method for AVL trees.c. (10 .pdfakanshanawal
 
Un dsl pour ma base de données
Un dsl pour ma base de donnéesUn dsl pour ma base de données
Un dsl pour ma base de donnéesRomain Lecomte
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfHiroshi Ono
 
Kotlin Basics - Apalon Kotlin Sprint Part 2
Kotlin Basics - Apalon Kotlin Sprint Part 2Kotlin Basics - Apalon Kotlin Sprint Part 2
Kotlin Basics - Apalon Kotlin Sprint Part 2Kirill Rozov
 
RESTful API using scalaz (3)
RESTful API using scalaz (3)RESTful API using scalaz (3)
RESTful API using scalaz (3)Yeshwanth Kumar
 

Similar to Java/Scala Lab: Slava Schmidt - Introduction to Reactive Streams (20)

Reactive streams. Slava Schmidt
Reactive streams. Slava SchmidtReactive streams. Slava Schmidt
Reactive streams. Slava Schmidt
 
HBaseConEast2016: HBase and Spark, State of the Art
HBaseConEast2016: HBase and Spark, State of the ArtHBaseConEast2016: HBase and Spark, State of the Art
HBaseConEast2016: HBase and Spark, State of the Art
 
ABA Problem
ABA ProblemABA Problem
ABA Problem
 
Coding in Style
Coding in StyleCoding in Style
Coding in Style
 
Basic iOS Training with SWIFT - Part 2
Basic iOS Training with SWIFT - Part 2Basic iOS Training with SWIFT - Part 2
Basic iOS Training with SWIFT - Part 2
 
PSUG #52 Dataflow and simplified reactive programming with Akka-streams
PSUG #52 Dataflow and simplified reactive programming with Akka-streamsPSUG #52 Dataflow and simplified reactive programming with Akka-streams
PSUG #52 Dataflow and simplified reactive programming with Akka-streams
 
Intro To Cascading
Intro To CascadingIntro To Cascading
Intro To Cascading
 
(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?(How) can we benefit from adopting scala?
(How) can we benefit from adopting scala?
 
SF Scala meet up, lighting talk: SPA -- Scala JDBC wrapper
SF Scala meet up, lighting talk: SPA -- Scala JDBC wrapperSF Scala meet up, lighting talk: SPA -- Scala JDBC wrapper
SF Scala meet up, lighting talk: SPA -- Scala JDBC wrapper
 
Meet Up - Spark Stream Processing + Kafka
Meet Up - Spark Stream Processing + KafkaMeet Up - Spark Stream Processing + Kafka
Meet Up - Spark Stream Processing + Kafka
 
Hive Functions Cheat Sheet
Hive Functions Cheat SheetHive Functions Cheat Sheet
Hive Functions Cheat Sheet
 
HBase Client APIs (for webapps?)
HBase Client APIs (for webapps?)HBase Client APIs (for webapps?)
HBase Client APIs (for webapps?)
 
b. (10 pts) Implement the rotate left method for AVL trees.c. (10 .pdf
b. (10 pts) Implement the rotate left method for AVL trees.c. (10 .pdfb. (10 pts) Implement the rotate left method for AVL trees.c. (10 .pdf
b. (10 pts) Implement the rotate left method for AVL trees.c. (10 .pdf
 
Un dsl pour ma base de données
Un dsl pour ma base de donnéesUn dsl pour ma base de données
Un dsl pour ma base de données
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdfpragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
pragmaticrealworldscalajfokus2009-1233251076441384-2.pdf
 
Kotlin Basics - Apalon Kotlin Sprint Part 2
Kotlin Basics - Apalon Kotlin Sprint Part 2Kotlin Basics - Apalon Kotlin Sprint Part 2
Kotlin Basics - Apalon Kotlin Sprint Part 2
 
RESTful API using scalaz (3)
RESTful API using scalaz (3)RESTful API using scalaz (3)
RESTful API using scalaz (3)
 

More from GeeksLab Odessa

DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...
DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...
DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...GeeksLab Odessa
 
DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...
DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...
DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...GeeksLab Odessa
 
DataScience Lab 2017_Блиц-доклад_Турский Виктор
DataScience Lab 2017_Блиц-доклад_Турский ВикторDataScience Lab 2017_Блиц-доклад_Турский Виктор
DataScience Lab 2017_Блиц-доклад_Турский ВикторGeeksLab Odessa
 
DataScience Lab 2017_Обзор методов детекции лиц на изображение
DataScience Lab 2017_Обзор методов детекции лиц на изображениеDataScience Lab 2017_Обзор методов детекции лиц на изображение
DataScience Lab 2017_Обзор методов детекции лиц на изображениеGeeksLab Odessa
 
DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...
DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...
DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...GeeksLab Odessa
 
DataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладDataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладGeeksLab Odessa
 
DataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладDataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладGeeksLab Odessa
 
DataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладDataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладGeeksLab Odessa
 
DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...
DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...
DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...GeeksLab Odessa
 
DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...
DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...
DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...GeeksLab Odessa
 
DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко
DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко
DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко GeeksLab Odessa
 
DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...
DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...
DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...GeeksLab Odessa
 
DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...
DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...
DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...GeeksLab Odessa
 
DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...
DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...
DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...GeeksLab Odessa
 
DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...
DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...
DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...GeeksLab Odessa
 
DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...
DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...
DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...GeeksLab Odessa
 
DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...
DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...
DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...GeeksLab Odessa
 
DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот
DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот
DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот GeeksLab Odessa
 
JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...
JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...
JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...GeeksLab Odessa
 
JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js
JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js
JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js GeeksLab Odessa
 

More from GeeksLab Odessa (20)

DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...
DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...
DataScience Lab2017_Коррекция геометрических искажений оптических спутниковых...
 
DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...
DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...
DataScience Lab 2017_Kappa Architecture: How to implement a real-time streami...
 
DataScience Lab 2017_Блиц-доклад_Турский Виктор
DataScience Lab 2017_Блиц-доклад_Турский ВикторDataScience Lab 2017_Блиц-доклад_Турский Виктор
DataScience Lab 2017_Блиц-доклад_Турский Виктор
 
DataScience Lab 2017_Обзор методов детекции лиц на изображение
DataScience Lab 2017_Обзор методов детекции лиц на изображениеDataScience Lab 2017_Обзор методов детекции лиц на изображение
DataScience Lab 2017_Обзор методов детекции лиц на изображение
 
DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...
DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...
DataScienceLab2017_Сходство пациентов: вычистка дубликатов и предсказание про...
 
DataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладDataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-доклад
 
DataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладDataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-доклад
 
DataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-докладDataScienceLab2017_Блиц-доклад
DataScienceLab2017_Блиц-доклад
 
DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...
DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...
DataScienceLab2017_Cервинг моделей, построенных на больших данных с помощью A...
 
DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...
DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...
DataScienceLab2017_BioVec: Word2Vec в задачах анализа геномных данных и биоин...
 
DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко
DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко
DataScienceLab2017_Data Sciences и Big Data в Телекоме_Александр Саенко
 
DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...
DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...
DataScienceLab2017_Высокопроизводительные вычислительные возможности для сист...
 
DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...
DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...
DataScience Lab 2017_Мониторинг модных трендов с помощью глубокого обучения и...
 
DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...
DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...
DataScience Lab 2017_Кто здесь? Автоматическая разметка спикеров на телефонны...
 
DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...
DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...
DataScience Lab 2017_From bag of texts to bag of clusters_Терпиль Евгений / П...
 
DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...
DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...
DataScience Lab 2017_Графические вероятностные модели для принятия решений в ...
 
DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...
DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...
DataScienceLab2017_Оптимизация гиперпараметров машинного обучения при помощи ...
 
DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот
DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот
DataScienceLab2017_Как знать всё о покупателях (или почти всё)?_Дарина Перемот
 
JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...
JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...
JS Lab 2017_Mapbox GL: как работают современные интерактивные карты_Владимир ...
 
JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js
JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js
JS Lab2017_Под микроскопом: блеск и нищета микросервисов на node.js
 

Recently uploaded

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksSoftradix Technologies
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024Scott Keck-Warren
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhisoniya singh
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxOnBoard
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxMalak Abu Hammad
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 

Recently uploaded (20)

SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 
Pigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping ElbowsPigging Solutions Piggable Sweeping Elbows
Pigging Solutions Piggable Sweeping Elbows
 
Benefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other FrameworksBenefits Of Flutter Compared To Other Frameworks
Benefits Of Flutter Compared To Other Frameworks
 
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024SQL Database Design For Developers at php[tek] 2024
SQL Database Design For Developers at php[tek] 2024
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | DelhiFULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
FULL ENJOY 🔝 8264348440 🔝 Call Girls in Diplomatic Enclave | Delhi
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Maximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptxMaximizing Board Effectiveness 2024 Webinar.pptx
Maximizing Board Effectiveness 2024 Webinar.pptx
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 

Java/Scala Lab: Slava Schmidt - Introduction to Reactive Streams

  • 2. Reactive Streams THEN Java Developer LATER Enterprise Architect NOW Scala Consultant TWITTER @slavaschmidt MAIL slavaschmidt@gmx.de
  • 4. Java 5/6/7 A stream can be defined as a sequence of data. A powerful concept that greatly simplifies I/O operations.
  • 5. Java 8 A sequence of elements supporting sequential and parallel aggregate operations.
  • 6. •sequence of data or instructions •hot or cold •bounded or unbounded •focus on data transfer and/or transformation
  • 8. •bulk data transfer •batch processing of large data sets •micro-batching •real-time data sources •embedded data-processing •monitoring and analytics •metrics, statistics composition •event processing •error handling
  • 9.
  • 10.
  • 11. MEET ALICE AND BORIS
  • 12. MEET ALICE AND BORIS
  • 15.
  • 16.
  • 17.
  • 22. MEET ALICE AND BORIS •Typical threads •Do some work •Exchange data
  • 23. Direct Calls private static final SThread alice = new SThread("RS-Alice") { @Override public void swap(int count) { super.swap(count); borice.swap(count); } }; private static final SThread borice = new SThread("RS-Borice") { @Override public void run() { while (!stopped()) { SwapEnvironment.work(); } } @Override public void swap(int count) { super.swap(count); } };
  • 24. Java IO “Let’s move some data”
  • 25. Java IO A PipedOutputStream PipedInputStream protected byte buffer[]; B
  • 26. Java IO A PipedOutputStream PipedInputStream B protected byte buffer[];
  • 27. Java IO A PipedOutputStream PipedInputStream B Write Block Transfer Block Read Block
  • 28. Java IO val alice = new SThread("RS-Alice") { override def swap(n: Int) { val out = new PipedOutputStream() val in = new PipedInputStream(out, size) super.swap(n) for (i <- 0 to n * rateA) out.write(Env.BEER) } } val borice = new SThread("RS-Borice") { override def swap(n: Int) { super.swap(n) for (i <- 0 to n * rateB) in.read() } }
  • 29. Java IO val alice = new SThread("RS-Alice") { override def swap(n: Int) { val out = new PipedOutputStream() val in = new PipedInputStream(out, size) super.swap(n) for (i <- 0 to n * rateA) out.write(Env.BEER) } } INCREASE val borice = new SThread("RS-Borice") { override def swap(n: Int) { super.swap(n) for (i <- 0 to n * rateB) in.read() } }
  • 30. Java IO val alice = new SThread("RS-Alice") { override def swap(n: Int) { val out = new PipedOutputStream() val in = new PipedInputStream(out, size) super.swap(n) for (i <- 0 to n * rateA) out.write(Env.BEER) } } INCREASE val borice = new SThread("RS-Borice") { override def swap(n: Int) { super.swap(n) for (i <- 0 to n * rateB) in.read() } }
  • 31. Java IO val alice = new SThread("RS-Alice") { override def swap(n: Int) { val out = new PipedOutputStream() val in = new PipedInputStream(out, size) super.swap(n) for (i <- 0 to n * rateA) out.write(Env.BEER) } } val borice = new SThread("RS-Borice") { override def swap(n: Int) { super.swap(n) for (i <- 0 to n * rateB) in.read() } } INCREASE
  • 32. Java IO Blocking is only a matter of time :(
  • 33. Java NIO “There is a better way”
  • 34. Java NIO A Buffer SinkChannel SourceChannel Buffer B Write Block Transfer Read Block Read Fill
  • 35. Java NIO val alice = new SThread("RS-Alice") { override def swap(n: Int) { val cnt = n * rateA val buffer = ByteBuffer.allocate(cnt) buffer.put(Vector.fill(cnt)(BEER).toArray) buffer.flip() val written = sinkChannel.write(buffer) super.swap(written) } } val pipe = Pipe.open() val sinkChannel = pipe.sink val sourceChannel = pipe.source sourceChannel.configureBlocking(true) sinkChannel.configureBlocking(false) BLOCKING val borice = new SThread("RS-Borice") { override def swap(n: Int) { val buffer = ByteBuffer.allocate(n * rateB) val cnt = sourceChannel.read(buffer) super.swap(cnt) } }
  • 36. Java NIO val alice = new SThread("RS-Alice") { override def swap(n: Int) { val cnt = n * rateA val buffer = ByteBuffer.allocate(cnt) buffer.put(Vector.fill(cnt)(BEER).toArray) buffer.flip() val written = sinkChannel.write(buffer) super.swap(written) } } val pipe = Pipe.open() val sinkChannel = pipe.sink val sourceChannel = pipe.source sourceChannel.configureBlocking(false) sinkChannel.configureBlocking(false) NON-BLOCKING val borice = new SThread("RS-Borice") { override def swap(n: Int) { val buffer = ByteBuffer.allocate(n * rateB) val cnt = sourceChannel.read(buffer) super.swap(cnt) } }
  • 37. Java NIO “Choose how to fail”
  • 39. IO & NIO Blocking or Dropping or Unbounded Scalability Non-Determinism OutOfMemory
  • 41. Solution Backpressure Dynamic Push/Pull Fast Boris
  • 42. Solution Backpressure Dynamic Push/Pull Fast Alice
  • 43. Backpressure A Stream B Demand Data Demand Data
  • 45. Java 8 public class ConsumerBorice extends SThread implements Consumer<byte[]> { public ConsumerBorice(String name) { super(name); } @Override public Consumer andThen(Consumer after) { return after; } @Override public void accept(byte[] bytes) { super.swap(bytes.length); } }
  • 46. Java 8 private static final ConsumerBorice borice = new ConsumerBorice("RS-Borice") { public void swap(int count) { } }; private static final SThread alice = new SThread ("RS-Alice") { byte[] items(int count) { byte[] result = new byte[count]; Arrays.fill(result, Env.BEER()); return result; } public void swap(int count) { Stream.of(items(count)).parallel() .filter(s -> s.equals(Env.BEER())) .forEach(borice); super.swap(count); } };
  • 47. Java 8 private static final ConsumerBorice borice = new ConsumerBorice("RS-Borice") { public void swap(int count) { } }; private static final SThread alice = new SThread ("RS-Alice") { byte[] items(int count) { byte[] result = new byte[count]; Arrays.fill(result, Env.BEER()); return result; } public void swap(int count) { Stream.of(items(count)).parallel() .filter(s -> s.equals(Env.BEER())) .forEach(borice); super.swap(count); } }; transformation static push (or pull) or sequential
  • 48. Java 8 private static final ConsumerBorice borice = new ConsumerBorice("RS-Borice") { public void swap(int count) { } }; private static final SThread alice = new SThread ("RS-Alice") { byte[] items(int count) { byte[] result = new byte[count]; Arrays.fill(result, Env.BEER()); return result; } public void swap(int count) { Stream.of(items(count)).parallel() .filter(s -> s.equals(Env.BEER())) .forEach(borice); super.swap(count); } Synchronous }; Non-Deterministic Limited Scalable Terminates on error
  • 49. Problems Synchronous Non-Deterministic Limited Scalable Terminates on error
  • 50. Problems Non-Deterministic Limited Scalable Terminates on error Synchronous
  • 52. Reactive Responsive Elastic Resilient Message Driven http://www.reactivemanifesto.org
  • 53. Reactive Streams … a standard for asynchronous stream processing with non-blocking backpressure. http://www.reactive-streams.org
  • 54. Participants Netflix rxJava, rxScala, … Oracle Pivotal Spring Reactor RedHat Vert.x Twitter Typesafe Akka Streams Ratpack
  • 55. Reactive Streams • Semantics (Specification) • API (Application Programming Interface) • TCK (Technology Compatibility Kit)
  • 56. API public interface Publisher<T> { void subscribe(Subscriber<? super T> var1); } public interface Subscriber<T> { void onSubscribe(Subscription var1); void onNext(T var1); void onError(Throwable var1); void onComplete(); } public interface Subscription { void request(long var1); void cancel(); }
  • 57. Subscription Producer Subscriber subscribe Subscription onSubscribe
  • 58. Streaming request Subscription onNext onComplete onError cancel Subscriber
  • 59. Publisher trait BytePublisher extends Publisher[Byte] { var subscriber: Subscriber[_ >: Byte] = _ override def subscribe(subscriber: Subscriber[_ >: Byte]) { this.subscriber = subscriber } } val alice = new SThread("RS-Alice") with BytePublisher { override def swap(n: Int) { for { i <- 1 to n } subscriber.onNext(Env.BEER) super.swap(n) } }
  • 60. Subscriber trait ByteSubscriber[T >: Byte] extends Subscriber[T] { var subscription: Subscription = _ override def onSubscribe(subscription: Subscription) { this.subscription = subscription } override def onError(t: Throwable) { } override def onComplete() { } } val borice = new SThread(“RS-Borice") with ByteSubscriber[Byte]{ def onNext(t: Byte) { super.swap(1) } }
  • 61. Right Subscriber val borice = new SThread(“RS-Borice") with ByteSubscriber[Byte]{ alice.subscribe(this) override def swap(n: Int) { subscription.request(n) } def onNext(t: Byte) { super.swap(1) } }
  • 62. Right Publisher trait BytePublisher extends Publisher[Byte] { var subscriber: Subscriber[_ >: Byte] = _ var subscription: Subscription = _ val counter = new AtomicInteger(0) def request(l: Long): Unit = { counter.addAndGet(l.toInt) } override def subscribe(subscriber: Subscriber[_ >: Byte]) { this.subscription = new ByteSub(this) this.subscriber = subscriber subscriber.onSubscribe(this.subscription) } } val alice = new SThread("RS-Alice") with BytePublisher { override def swap(n: Int) { val cnt = math.min(n, counter.get()) counter.addAndGet(-cnt) for { i <- 1 to cnt } subscriber.onNext(Env.BEER) super.swap(n) } }
  • 63. Akka Streams implicit val mat = FlowMaterializer()(system) Source(alice).runWith(Sink(borice))
  • 66. RxReactiveStreams import rx.RxReactiveStreams._ subscribe(toObservable(alice), borice)
  • 67. Vert.X //vert.x 3.0 - only supports Streams[Buffer] val rws = ReactiveWriteStream.writeStream() rws.subscribe(borice) val rrs = ReactiveReadStream.readStream() alice.subscribe(rrs) val pump = Pump.pump(rrs, rws) pump.start()
  • 68. Why should I care?
  • 69. Because •Simplifies reactive programming •Rises program’s abstraction level •May be future JDK standard
  • 78. Shop Admin ADs Stats Delivery WebShop Merchant
  • 79. Shop Admin DB ADs Stats Delivery WebShop Merchant REST File System Messaging REST
  • 80. Shop Admin (vert.x) Delivery (Spring) WebShop (ratpack.io) Merchant (Akka) ADs (Rx…) Stats (Spray) DB REST File System Messaging REST
  • 81. Shop Admin (vert.x) Delivery (Spring) WebShop (ratpack.io) Merchant (Akka) ADs (Rx…) Stats (Spray) DB
  • 82. Shop Admin (vert.x) Data Flow Backpressure Delivery (Spring) WebShop (ratpack.io) Merchant (Akka) ADs (Rx…) Stats (Spray) DB
  • 85. Example Akka val display = { def ellipse (i: Input) = setColor(i).fillOval(i(3), i(4), i(5), i(6)) def rect (i: Input) = setColor(i).fillRect(i(3), i(4), i(5), i(6)) val logics: Seq[(Input) => Unit] = Seq(ellipse, rect) def rnd = Random.nextInt(255) val timer = Source(0.seconds, 1.second, () => rnd ) val randoms = Source { () => Some(rnd) } val functions = timer map { i => logics(i % logics.size) } val display = functions map { f => val groups = randoms.take(7) val params = groups.fold(List.empty[Int])((l, i) => i :: l) for { p <- params } f(p) } display } def start = { display.runWith(BlackholeSink) }
  • 86. Use Case Price Correction System
  • 87. Product schedules Competitors Volatile sources Audit Historical trends Alerts Sales Heuristics Pricing Rules Adjustments
  • 88. Timer Scheduler Competitors Volatile sources Audit Historical trends Alerts Sales Heuristics Pricing Rules Adjustments
  • 89. Timer Scheduler Robots Volatile sources Audit Historical trends Alerts Sales Heuristics Pricing Rules Adjustments
  • 90. Timer Scheduler Robots Audit Historical trends Alerts Sales Heuristics Pricing Rules Adjustments Validators
  • 91. Timer Scheduler Robots Historical trends Alerts Sales Heuristics Pricing Rules Adjustments Logger Validators
  • 92. Timer Scheduler Robots Stock Logger Validators Historical trends Pricing Rules Alerts Adjustments
  • 93. Timer Scheduler Robots Stock Logger Validators Pricing Historical trends Alerts Adjustments
  • 94. Timer Scheduler Robots Stock Logger Validators Historical trends Alerts Pricing Ruler
  • 95. Timer Scheduler Robots Stock Logger Validators Pricing Ruler Safety Historical trends
  • 96. Timer Scheduler Robots Stock Logger Validators Pricing Ruler Safety Archive
  • 97. Timer Scheduler Validators Stock Logger Robots Pricing Archive Safety Ruler Data Flow Backpressure
  • 98. val schedules = Flow[Date] mapConcat generateSchedules val robots = Flow[Schedule] map scrape val validations = Flow[ScrapeResult] map { site => logSite(site) validate(site) } val pricing = Flow[Validation] map checkPrice val stock = Flow[Validation] map checkStock val ruler = Flow[(Price, Stock)] map applyRule val safety = Flow[Rule] map checkSafety val zip = Zip[Price, Stock] val split = Broadcast[Validation]
  • 99. Timer Scheduler Validators Stock Logger Robots Pricing Archive Safety Ruler Data Flow Backpressure
  • 100. val timer = Source(0.seconds, 1.minute, () => now) val archive = ForeachSink[SafetyCheck] { logRule } val graph = FlowGraph { implicit builder => timer ~> schedules ~> robots ~> validations ~> split split ~> stock ~> zip.right split ~> pricing ~> zip.left ~> ruler ~> safety ~> archive } graph.run()
  • 101. 24 cores 48 Gb 24 cores 48 Gb 150 000 000 positions daily
  • 103. Reactive Streams •Simplify reactive programming •Rise program’s abstraction level •May be future JDK standard
  • 105. Thank you @slavaschmidt slavaschmidt@gmx.de