Industrial Applications of Reactive Distillation: Recent Trends
Imperative to Reactive Web Applications
-
Upload
spring-io -
Category
Technology
-
view
1.358 -
download
2
Transcript of Imperative to Reactive Web Applications
![Page 1: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/1.jpg)
![Page 2: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/2.jpg)
![Page 3: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/3.jpg)
Reactive Programmingfor Java developers
Part 1
![Page 4: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/4.jpg)
Long RunningShift ToConcurrency
![Page 5: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/5.jpg)
10 years ago
Today
![Page 6: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/6.jpg)
![Page 7: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/7.jpg)
![Page 8: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/8.jpg)
Design async API with Java Futures
![Page 9: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/9.jpg)
...
...
![Page 10: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/10.jpg)
![Page 11: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/11.jpg)
...
![Page 12: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/12.jpg)
![Page 13: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/13.jpg)
...
...
![Page 14: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/14.jpg)
![Page 15: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/15.jpg)
...
...
![Page 16: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/16.jpg)
...
...
![Page 17: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/17.jpg)
...
...
![Page 18: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/18.jpg)
![Page 19: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/19.jpg)
![Page 20: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/20.jpg)
Async return valuesas a stream?
![Page 21: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/21.jpg)
![Page 22: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/22.jpg)
Return type Use case Notificationsvoid Success onComplete()
void Failure onError(Throwable)
User Match onNext(User), onComplete()
User No match onComplete()
User Failure onError(Throwable)
List<User> Two matches onNext(User), onNext(User), onComplete()
List<User> No match onComplete()
List<User> Failure onError(Throwable)
![Page 23: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/23.jpg)
Java 8 Stream
![Page 24: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/24.jpg)
Java 8 Stream
![Page 26: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/26.jpg)
Reactive Streams
![Page 27: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/27.jpg)
public interface Subscriber<T> {
void onSubscribe(Subscription sub);
void onNext(T item);
void onError(Throwable ex);
void onComplete();
}
public interface Subscription {
void request(long n);
void cancel();
}
public interface Publisher<T> {
void subscribe(Subscriber<? super T> subscriber);
}
Reactive Streams
![Page 28: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/28.jpg)
Project Reactor
![Page 29: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/29.jpg)
Mono [0..1] sequence
![Page 30: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/30.jpg)
![Page 31: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/31.jpg)
![Page 32: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/32.jpg)
![Page 33: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/33.jpg)
![Page 34: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/34.jpg)
onSubscribe
request(unbounded)
onNext(User: Jason)
onNext(User: Jay)
...
onComplete()
![Page 35: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/35.jpg)
![Page 36: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/36.jpg)
onSubscribe
request(2)
onNext(User: Jason)
onNext(User: Jay)
request(2)
onNext(User: Joe)
onNext(User: John)
...
![Page 37: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/37.jpg)
ReactiveWeb Applications
Part 2
![Page 38: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/38.jpg)
public UserRepositoryImpl implements UserRepository {
public Mono<User> findUser(Long id) {
|
}
}
![Page 39: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/39.jpg)
![Page 40: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/40.jpg)
![Page 41: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/41.jpg)
![Page 42: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/42.jpg)
![Page 43: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/43.jpg)
![Page 44: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/44.jpg)
![Page 45: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/45.jpg)
![Page 46: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/46.jpg)
![Page 47: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/47.jpg)
![Page 48: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/48.jpg)
![Page 49: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/49.jpg)
Flux<T> Flux<DataBuffer>
![Page 50: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/50.jpg)
![Page 51: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/51.jpg)
![Page 52: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/52.jpg)
![Page 53: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/53.jpg)
![Page 54: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/54.jpg)
![Page 55: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/55.jpg)
![Page 56: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/56.jpg)
![Page 59: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/59.jpg)
![Page 60: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/60.jpg)
More HttpServer variants at spring-web/src/test/java
![Page 61: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/61.jpg)
![Page 62: Imperative to Reactive Web Applications](https://reader031.fdocuments.net/reader031/viewer/2022022203/586fdb811a28ab18428b6127/html5/thumbnails/62.jpg)