May 2017
Intermediate to advanced
590 pages
17h 18m
English
The promise-future pair is basically a communication channel that enables a thread to communicate a value or exception with another thread through a shared state. The promise is an asynchronous provider of the result and has an associated future that represents an asynchronous return object. To establish this channel, you must first create a promise. This, in turn, creates the shared state that can be later read through the future associated with the promise.
To set a result to a promise, you can use any of the following methods:
Read now
Unlock full access