Tomorrowland v0.4.0 Release Notes
Release Date: 2018-11-27 // over 5 years ago-
- ๐ Improve the behavior of
.delay(on:_:)
and.timeout(on:delay:)
when usingPromiseContext.operationQueue
. The relevant operation is now added to the queue immediately and only becomes ready once the delay/timeout has elapsed. - โ Add
-[TWLPromise initCancelled]
to construct a pre-cancelled promise. - โ Add
Promise.init(on:fulfilled:after:)
,Promise.init(on:rejected:after:)
, andPromise.init(on:result:after:)
. These initializers produce something akin toPromise(fulfilled: value).delay(after)
except they respond to cancellation immediately. This makes them more suitable for use as cancellable timers, as opposed to.delay(_:)
which is more intended for debugging (#27). - ๐ Try to clean up the callback list when calling
PromiseInvalidationToken.requestCancelOnInvalidate(_:)
. Any deallocated promises at the head of the callback list will be removed. This will help keep the callback list from growing uncontrollably when a token is used merely to cancel all promises when the owner deallocates as opposed to being periodically invalidated during its lifetime (#25). - Cancel the
.delay(_:)
timer if.requestCancel()
is invoked and the upstream promise cancelled. This way requested cancels will skip the delay, but unexpected cancels will still delay the result (#26).
- ๐ Improve the behavior of