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 using PromiseContext.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:), and Promise.init(on:result:after:). These initializers produce something akin to Promise(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).