Future!T that can be cancelled via token.Future!T withCancel(CancelToken token) @trustedAttach an external cancellation token to this future.
If the token is already cancelled, the returned future is cancelled immediately. Otherwise, the returned future mirrors this future's result (resolve, reject, or cancel) unless the token fires first, in which case the returned future is cancelled.
token | External cancellation token to observe. |
Future!T that can be cancelled via token.