The type of the resolved value
Optional context type for additional data
Optional ReadonlyctxReadonlyidLazily-generated unique identifier for this Future. Not cryptographically secure, but suitable for transaction/debug tracking.
Returns the underlying Promise that will be resolved or rejected.
The Promise representation of this Future
Resolves the Future with the given value.
The value to resolve the Promise with
Rejects the Future with the given reason.
The reason for rejection (typically an Error)
A Promise that can be resolved or rejected externally after creation.
Future provides a way to create a Promise whose resolution is controlled externally rather than in the executor function. This is useful for coordinating async operations, implementing custom async primitives, or bridging callback-based APIs to promises.
Example