A value that is not here yet
A future is a read only handle to a result that will arrive later. A promise is the matching write side: whoever owns the promise eventually fulfills it with a value or rejects it with an error.
Why split the two sides
- The producer holds the promise and decides the outcome.
- The consumer holds the future and only reads it.
- This separation stops a reader from secretly completing someone else work.
A future has three states: pending, fulfilled, and rejected. Once it leaves pending it is settled and never changes again. That immutability is what makes futures safe to share across many readers.
Registering interest
Instead of blocking a thread, you attach a callback that fires when the future settles. The runtime stores the callback and invokes it once the promise is resolved. Multiple readers can attach to the same future and all of them are notified.
A common shape
The promise and future are often bundled into one object, as in JavaScript, where resolve and reject are passed to the executor.
Key idea
A future is the read side of a result that does not exist yet, and a promise is the write side that settles it exactly once.