Tuesday, December 29, 2020

Scala Futures: Concurrency Interpreted!

Futures allow us to run values off the main thread and handle values that are running in the background or yet to be executed by mapping them with callbacks.

If you come from a Java background, you might be aware of java.util.concurrent.Future. There are several challenges in using this:
  1. Threads are always blocked while retrieving values.
  2. The wait time for the completion of computation.
  3. The GET method is the only way to retrieve values.

It’s a weary and antagonistic way of writing concurrent code.



from DZone.com Feed https://ift.tt/34NcbbD

No comments:

Post a Comment