• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Reactive Programming Course - Week 3 Video Lectures

 
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I started going through the video lectures for Week 3 and I'm finding it a bit different and interesting. First thew topics on Futures and Promises are interesting and second, the way the videos are made is also a bit different compared to the other videos from Martin Oedersky!
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Following up on the video lectures of Week 3, I get some sort of impression that Try Monad is for synchronous computation, while the Future Monad is for asynchronous computation.

What would then be the difference between Try[Future[T]] and Future[Try[T]]?
 
Sheriff
Posts: 5555
326
IntelliJ IDE Python Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I'm just getting into these videos now.

I think the difference you question would come down to order. You either have a synchronous (Try) way to access an asynchronous resource (Future), or you have an asynchronous (Future) way to access a synchronous (Try) resource. I think in practice though the Try part would be redundant wouldn't it? Some experimentation would be in order to discern any observable (pun not intended) difference in behaviour.
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, a Future inside a Try seems redundant, but I see it as a way to get the value out of a Future. For example., in a typical web app modelled after the Java EE blueprint design patterns, the Facade / Servlet layer calls the Business layer which in-turn calls the DAO layer. I could make the methods in my Business layer and the DAO layer return a Future, while wrapping this in a Try in my Facade and return the value or redirect to an error page depending on what the Future contained in it.
 
Joe San
Ranch Hand
Posts: 10198
3
Mac PPC Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I did manage to get Part 1 assignments done. I have to now work on Part 2!
 
Grow your own food... or this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic