How to Write Controllable Futures in Scala | Rock the JVM

แชร์
ฝัง
  • เผยแพร่เมื่อ 7 ก.พ. 2025
  • Written form to keep for later: blog.rockthejv...
    This video is for the Scala programmers who are facing the problem of "manually" fulfilling Futures. I give the prototypical example of what happens in practice, when you have a multi-threaded service out of your control, yet you need to use it and extract a sensible API out of it.
    I will introduce Promises, how they work, how they fit into the producer-consumer paradigm, and solve the problem at hand.
    Follow Rock the JVM on:
    LinkedIn: / rockthejvm
    Twitter: / rockthejvm
    Blog: rockthejvm.com...
    -------------------------------------------------------------------------
    Home: rockthejvm.com
    -------------------------------------------------------------------------

ความคิดเห็น • 14

  • @Krazness
    @Krazness ปีที่แล้ว +1

    I started an new job that uses Scala and your videos have helped me tremendously. Thank you

    • @rockthejvm
      @rockthejvm  ปีที่แล้ว

      Glad to have played a small part!

  • @vetiarvind
    @vetiarvind 4 วันที่ผ่านมา +1

    jeez that was a mind trip for my smooth brain

  • @anishkumar-uk6yr
    @anishkumar-uk6yr 4 ปีที่แล้ว +1

    Feeling Good to see you here I have learned Scala bcz of you

  • @mourikogoro9709
    @mourikogoro9709 4 ปีที่แล้ว +6

    Good tutorial again! But the implementation itself is too messy for just realizing a simple idea, "process a value from Future"?

    • @rockthejvm
      @rockthejvm  4 ปีที่แล้ว

      The problem the video wants to show is how to deterministically fulfil a Future, not necessarily how to process it.

  • @BogdanDimitriu
    @BogdanDimitriu 4 ปีที่แล้ว +6

    This example for Promises seems slightly convoluted, but it eventually drives the idea home. Keep up the good work otherwise ;)

    • @rockthejvm
      @rockthejvm  4 ปีที่แล้ว

      Glad it eventually clicked!

  • @somdevpahari5165
    @somdevpahari5165 3 ปีที่แล้ว

    Hi Daniel, really helpful video. But I have one different scenario. Lets say, I have one batch process which is using Slick. Now by design Slick returns Future. If I want executes Futures in a sequential way and want the main method to wait until all the Futures are executed then what could be the best possible implementation. Right now I am using Await though. If anything other than using Await.

    • @rockthejvm
      @rockthejvm  3 ปีที่แล้ว +3

      Use Future.traverse or Future.sequence.

  • @jeronimogarcia-loygorri1125
    @jeronimogarcia-loygorri1125 4 ปีที่แล้ว

    I can't make the code run and the link to the blog is broken. In the blog index there is this link, also broken (rockthejvm.com/blog/205441/conttrollable-futures). Any help will be appreciated
    I learn a lot with you videos.
    Thank you

  • @d4devotion
    @d4devotion 3 ปีที่แล้ว

    Things have gone very much confusing here Daniel, would have been better to take a simple example to explain why and where need to play with a promise manually.

    • @rockthejvm
      @rockthejvm  3 ปีที่แล้ว

      That was the goal of the video :(

  • @halildogan6435
    @halildogan6435 4 ปีที่แล้ว

    Hi Daniel, thanks for the video. I sent you an email regarding your udemy courses. Could you please check it when you have time?