You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
extensionPromise{
/// Returns a new `Promise` that cancels immediately when requested.
///
/// The new promise adopts the value of the receiver, unless the new promise
/// is requested to cancel first. When `requestCancel()` is invoked the new
/// promise will cancel itself immediately in addition to propagating the
/// cancel upwards. This means the resulting promise will support
/// cancellation even if the upstream promise doesn't.
///
/// - Note: This method means the resulting promise can resolve to the
/// `.cancelled` state even if the upstream promise is fulfilled or
/// rejected.
publicfunc cancellingImmediatelyUponRequest()->Promise{returnPromise(on:.immediate,{(resolver)inletupstream=self.inspect(on:.immediate,{(result)in
resolver.resolver(with: result)})
resolver.onCancelRequested(on:.immediate){[upstream=upstream.cancellable](resolver)in
resolver.cancel()
upstream.requestCancel()}})}}
It's not clear yet if this function is useful enough to justify its inclusion in the core library.
The text was updated successfully, but these errors were encountered:
We might want to add a function like
It's not clear yet if this function is useful enough to justify its inclusion in the core library.
The text was updated successfully, but these errors were encountered: