February 2018
Intermediate to advanced
552 pages
13h 46m
English
Like a Scala Future, a Scala Promise is an object used to write AP. It is used to execute asynchronous code.
Like a Scala Future, a Scala Promise may have a value if it finishes successfully, or an exception or error if it finishes with some failure. We can say a Promise is completed if it finishes with a value or an exception. The following diagram defines what a Scala Promise is:

As we discussed, a Future is a placeholder to hold a computation unit (which returns a value or exception and does not yet exist). It is used to read that result, whereas a Promise is used to finish that computation and write a value into ...
Read now
Unlock full access