I am writing a library in C++ (making use of many C++11 features) that (as far as I can tell) implements the promise pattern.
The library consists of a class that makes asynchronous network requests. When a user of this class invokes a method that issues a network request, an instance of another class (we'll call it the "promise class") is returned that provides methods for canceling the request.
Since this application uses the Qt framework, the promise class also emits signals when certain events happen, one of which is the successful completion of the request. Because the result of the network request is often included when the signal is emitted, I feel that this class implements the promise pattern.
According to the Wikipedia article:
"In computer science, future, promise, and delay refer to constructs used for synchronizing in some concurrent programming languages. They describe an object that acts as a proxy for a result that is initially unknown, usually because the computation of its value is yet incomplete."
* emphasis mine
Have I missed anything? Does my class indeed implement the promise pattern?
std::promise<T>?