Demo the reactive jargons

808 views
685 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
808
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
5
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Demo the reactive jargons

  1. 1. Demo the reactive jargons Mushtaq Ahmed ThoughtWorks @mushtaqA
  2. 2. getProductPage getModule1 getModule2 getPricing getProductSpec
  3. 3. square(a: Int): Intsquares(a: Seq[Int]): Seq[Int]
  4. 4. Demo
  5. 5. ● Async and NonBlocking mean different things ○ Async is about API ○ NonBlocking is about Implementation ● Async API can be implemented for Blocking calls! ● For NonBlocking calls, Sync API is not possible! ○ Macros and CPS transformations can be used to fake it
  6. 6. Blocking Non-blocking Sync square(a: Int): Int XXX Async square(a: Int): Future[Int] square(a: Int): Future[Int] API Implementation
  7. 7. Demo
  8. 8. ● Blocking IO is contagious ○ ExecutionContext helps to quarantine it ● Separate ExecutionContext for Blocking and NonBlocking IO ○ Like different speed lanes
  9. 9. Demo
  10. 10. ● Error handling in Future is a bit difficult for bulk operation ● Observable is a nicer alternative ○ Yet to explore: Retry, Timeout etc ● Observable API does not support backpressure ○ Be Careful not to introduce memory leaks
  11. 11. Single Multiple Sync square(a: Int): Int squares(a: Seq[Int]): Seq[Int] Async square(a: Int): Future[Int] squares(a: Seq[Int]): Future[Seq [Int]] squares(a: Seq[Int]): Observable[Int] Observable[Int] == Future[Iterable[Future[Int]]]
  12. 12. The code for demo is here: https://github.com/mushtaq/pune-scala-symposium
  13. 13. ● We like to teach Scala ● We are planning to offer a FREE training in Pune! ○ Screening based on coding test ;) ● 4 full day sessions ○ Two consecutive Friday-Saturdays ● Sometime in May or June ○ Will announce it via @punescala/Pune Scala meetup group
  14. 14. Thank you

×