A Guide To CompletableFuture in Java with Examples | Asynchronous Operations in Java | Geekific

Поділитися
Вставка
  • Опубліковано 27 вер 2024

КОМЕНТАРІ • 26

  • @OldBalance42
    @OldBalance42 Рік тому +6

    Great explanation, better than other guides on the internet.

  • @caiosaldanha2371
    @caiosaldanha2371 5 місяців тому +1

    That was the best explamnation so far! Thank you very much!

  • @pavankumar-hg9ot
    @pavankumar-hg9ot 3 місяці тому +1

    Excellent information

  • @mac_88_59
    @mac_88_59 7 місяців тому +1

    This explanation is amazing and so clear. Thank you.

  • @Official_Joshua
    @Official_Joshua Рік тому +1

    Thanks so much for this video it helped alot. This is the best one yet. i tried all the other videos and this one made it clear

  • @iaburrahman3454
    @iaburrahman3454 11 місяців тому +1

    Enjoyable explanation. Thanks a lot.

  • @alitahboub493
    @alitahboub493 13 днів тому

    amazing video

  • @misaelpereira9679
    @misaelpereira9679 8 місяців тому +1

    Such a wonderful explanation with good examples of each scenario, definitely you get to the point!, you get a new suscriber!

  • @faisalahmed4054
    @faisalahmed4054 2 місяці тому

    great explanation

  • @radhikashroff2643
    @radhikashroff2643 10 місяців тому

    Excellent Explanation !

  • @shashikantnipanikar860
    @shashikantnipanikar860 5 місяців тому

    Really helpful

  • @ppdmartell
    @ppdmartell Рік тому

    @geekific dude, your videos are jewels.

  • @svalyavasvalyava9867
    @svalyavasvalyava9867 2 роки тому

    Thank you!!! Great topic and explanation of it.

  • @MD.PoragSarkar
    @MD.PoragSarkar 2 місяці тому

    Liked and subscribed...

  • @KarthickKesavan-s8i
    @KarthickKesavan-s8i Місяць тому

    Can u make a video on writing test cases for CompletableFutures

    • @geekific
      @geekific  Місяць тому

      Will add it to my list, stay tuned!

  • @liam45537
    @liam45537 Рік тому +15

    Hands down the best explanation of completable futures out there. You're a master at explaining difficult concepts

    • @geekific
      @geekific  Рік тому +1

      Thanks! Glad it helped :)

  • @arnabchowdhury4892
    @arnabchowdhury4892 10 місяців тому

    Please create video on fork and join

  • @abdelkrimhaddadi5098
    @abdelkrimhaddadi5098 Рік тому

    Perfect Thanks a lot !

  • @Talaria.School
    @Talaria.School 2 роки тому

    Thanks a lot

  • @acekokuren
    @acekokuren Рік тому

    I wondered if you might have tackled it elsewhere, but when I attempt to use the .sleep() method, it says that an InterruptedException can be thrown. Now I can handle this by either adding it to the method signature, or use a try-catch block. Now when I use a try-catch block, there is a warning that it is not enough to simply ignore the exception that is thrown, it needs to be re-thrown or interrupted.
    I have used something along the lines of:
    ```
    ...
    try {
    TimeUnit.x.sleep(y);
    } catch (InterruptedException e) {
    Thread.currentThread.interrupt();
    }
    ...
    ```
    Now I have no idea what the reason is behind this, and then when I have tried to throw the InterruptedException, it asks me to surround it in a try catch block inside the catch block.
    Not sure if this is thread specific, and if you covered it anywhere else, or able to cover it.
    Thanks in advance for any information.

    • @geekific
      @geekific  Рік тому +3

      First, you just gave me an idea for a video! Thanks :)
      And to briefly answer your question, yes what you are doing is the way to go, and that's because each thread has kind of an "interrupted" flag, and if you simply ignore the exception, the thread's interrupted flag will not be set, and it will continue executing as if nothing happened, or that thread won't be handled appropriately by other threads. By calling this method in the catch block, you are setting the interrupted flag on the thread that was interrupted, allowing other parts of your code to check it and handle the thread appropriately. Hope this partly answers it, and stay tuned for more videos!

  • @petrow_
    @petrow_ 5 місяців тому +1

    So cool, at last. Thanks a lot!

  • @gamesandstuff4188
    @gamesandstuff4188 6 місяців тому

    Great explanation