Back to Developer Roadmap

Future & Promises

src/data/roadmaps/server-side-game-developer/content/[email protected]

4.0616 B
Original Source

Future & Promises

Futures and promises or simply Promises in programming is a pattern used for handling asynchronous operations. A Promise is an object that might produce a single value or error in the future either through a non-blocking way or in an asynchronous way. A Promise has three states - pending, resolved (success), and rejected (error). The Promise transitions from the Pending state to either an accomplished Resolved state, or Rejected state. These status changes are irreversible, meaning once the Promise reaches either Resolved or Rejected state, it cannot transition to any other state.