EXOTIC FISH IN EAST ANGLIAN WATERS: PORCUPINEFISH DIODON HYSTRIX & PIRANHA PYGOCENTRUS SP
Reactive programming and Hystrix fault tolerance by Max Myslyvtsev
-
Upload
javadayua -
Category
Technology
-
view
393 -
download
0
Transcript of Reactive programming and Hystrix fault tolerance by Max Myslyvtsev
Why Reactive?
• Event-driven applications
• Easy dependency composition
• Allows parallel execution
6
Why Reactive?
• Event-driven applications
• Easy dependency composition
• Allows parallel execution
• No callback hell
7
ObservableObserver
onNext
onComplete
onError
Subscription
unsubscribe
Observable
subscribe
Work
start
stopemit
X
CreationCreate
Observer
onNext
onComplete
onError
Subscription
unsubscribe
Observable
subscribe
onSubscribe
X
Source Observable
Lift
onNext
onComplete
onError
New Observable
onNext
onComplete
onError
Operator
23
TerminationBlockingObservable
Single[OrDefault]
First[OrDefault]
Last[OrDefault]
ToIterable
ToBlocking
Observable
24
Observable<List>
Termination
ToListBlockingObservable<List>
Single[OrDefault]ToBlocking
Observable
25
Temperature
Cold
• Lazy • Does not emit until subscribed • Whole sequence
Hot
• Eager • Emits regardless of subscriptions • Partial sequence
26
Scheduling
Observable
subscribeOn
observeOn
Schedulers
Immediate
Trampoline
New Thread
Computations
IO
From(Executor)
Test
27
Command
Hystrix
Fragile Operation
API
Observable
Future
Sync Execute
Remote Service
Metrics Dashboard
Configuration
Fallback
29
How we use it
30
Server
REST Resources
Client
Maven Plugin
Generated Client Hystrix
generate during build
REST API
RX API
same API