Demo the reactive jargons by Mushtaq Ahmed, ThoughtWorks presented at Pune Scala Symposium 2014, ThoughtWorks

2,126 views
2,000 views

Published on

Sync, Async, Blocking, Non-Blocking, Streaming are the buzzwords in the reactive programming world. This talk will attempt to attach some meaning to them. It will also demo the performance and resource consumption patterns for blocking-io, Scala Futures and RxJava Observables for comparable programs. Finally, a command line application that consumes twitter streams API will demo what is possible using the new reactive abstractions.

Published in: Technology, Travel
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,126
On SlideShare
0
From Embeds
0
Number of Embeds
553
Actions
Shares
0
Downloads
6
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Demo the reactive jargons by Mushtaq Ahmed, ThoughtWorks presented at Pune Scala Symposium 2014, ThoughtWorks

  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

×