Promises and asynchrony: S/W Promises defined with words normal people can read

Promises have a simple lifecycle. Initially, a promise is unresolved – it represents the expectation of receiving a result at some unspecified future time. When the result is received, the promise becomes fulfilled and the result becomes the value of the promise. If an error occurs, either in the calculation of the result or in the communications between the requesting and responding grains, the promise becomes broken and has no value. A promise that has been fulfilled or broken is considered resolved.

Software promises are initially unresolved, there is an expectation of receiving a non-scheduled result.  When the expected, but not scheduled result occurs or is received, the promise is fulfilled, the promise is now the value of the promise.

What about errors?  Promises are resolved if they get an error because of calculation or communications errors.

So in the computer Promises are unresolved or resolved.  No surprise there.  When a promise can be resolved by being fulfilled, which could be the result of a successful receipt of the triggered result or with an error caused by calculation errors or communication errors.

Try that with your sweetie.

Promise: I will get bread and milk on the way home.

Result: I got shortbread cookies and milky way bars on the way home.

In the computer that promise would be considered as resolved.  In your house, the promise may not be considered resolve.

If you got nothing on the way home, the promise would be unresolved.

It’s that simple. 

Comments (0)

Skip to main content