reactive streams condensed

27
REACTIVE STREAMS CONDENSED WHAT DO YOU NEED TO KNOW ABOUT NEW STANDARD FROM JVM WORLD

Upload: artur-skowronski

Post on 17-Jul-2015

221 views

Category:

Technology


1 download

TRANSCRIPT

Page 1: Reactive Streams Condensed

REACT I V E S TR EAMS COND ENS ED

W H A T D O Y O U N E E D T O K N O W A B O U T N E W S T A N D A R D F R O M J V M W O R L D

Page 2: Reactive Streams Condensed

The Java World was Sad Once…

Page 3: Reactive Streams Condensed

... Here comes Java 8…

Page 4: Reactive Streams Condensed

…And new King

Page 5: Reactive Streams Condensed

Not Enough

Page 6: Reactive Streams Condensed

STREAMS ARENot LAZY

Page 7: Reactive Streams Condensed

stream.forEach(x -> {return x * 2;

})

Page 8: Reactive Streams Condensed

DON’T HAVE API TO REALTIME, DISTRIBUTED PROCESSING

Page 9: Reactive Streams Condensed

Only Push orPull

Page 10: Reactive Streams Condensed

stream.forEach(x -> {return x * 2;

})

Page 11: Reactive Streams Condensed

Iterator i = stream.iterator()while (i.hasNext()){// do execution

}

Page 12: Reactive Streams Condensed

NOT A SPECIFICATIONNot A Specification

Page 13: Reactive Streams Condensed

JVM is not just Java

Page 14: Reactive Streams Condensed

Reactive Streams

Page 15: Reactive Streams Condensed

Stream Over AsyncBoundaries

Page 16: Reactive Streams Condensed

FAST PublisherSlow SubscriberProblem

Page 17: Reactive Streams Condensed

Publisher Subscriber

Demand

Data

Page 18: Reactive Streams Condensed
Page 19: Reactive Streams Condensed

RxJavaReactor from SpringSourceAkka StreamsVert.x

INTEROPERATIBILITY

Page 20: Reactive Streams Condensed

void onSubscribe(Subscription s)

void onNext(T t)

void onComplete()

void onError(Throwable t)

SUBSCRIBER

Page 21: Reactive Streams Condensed

void subscribe(Subscriber<? super T> s)

PUBLISHER

Page 22: Reactive Streams Condensed

SUBSCRIPTION

void cancel()

void request(long n)

Page 23: Reactive Streams Condensed

extendsSubscriber<T>, Publisher<R>

PROCESSOR

Page 24: Reactive Streams Condensed

Publisher Subscribersubscribe

onSubscribe

request

Subscription

onNext

Page 25: Reactive Streams Condensed

• All call on subscriber must be async• All call on Subscription must not block• Publisher just create subscription

CONTRACT

Page 26: Reactive Streams Condensed

• 1.0.0 RC-5 published 10th April• Technology Compatibility Kit Released • JVM Interface• JS Interface• Network Protocols

CURRENT STATE

Page 27: Reactive Streams Condensed

Thank You!