Releases: evaera/roblox-lua-promise
Releases · evaera/roblox-lua-promise
Promise v4.0.0
[4.0.0]
Changed
Promise:finallyno longer observes a rejection from a Promise. CallingPromise:finallyis mostly transparent now.- The Promise returned by
Promise:finallyresolves or rejects with whatever the parent Promise resolved or rejected with. It will be cancelled if the parent Promise is cancelled. - The value returned from the
finallyhandler is discarded now. - If the value returned from the
finallyhandler is a Promise, we wait for it to resolve, but we do not use its value. - If the value returned from the
finallyhandler is a Promise and it rejects,finallyreturns the new rejected value.
- The Promise returned by
Promise:finallyno longer counts as a consumer of the parent Promise for cancellation purposes. If all consumers are cancelled and the only remaining callbacks are finally handlers, the Promise is now cancelled.- The Promise executor thread is now closed with
coroutine.closewhen the Promise is cancelled. - The Promise executor thread is now closed after the Promise settles (calling
resolveorreject). - Callbacks enqueued with
andThenandcatchare now dequeued if the Promise returned byandThen/catchis cancelled. - Calling
andThenorcatchon an already-cancelled Promise now returns a cancelled Promise instead of returning a rejected Promise :await,:expect, and:awaitStatusare no longer backed by BindableEvents, and now use the task library directly, so performance should be better.
Removed
Promise:doneand its associated members have been removed.
roblox-lua-promise v4.0.0 Release Candidate 2
[4.0.0-rc.2] - 2022-01-02
Fixed
- Fix bug where Promise.fold does not return correct value if there is an unresolved Promise in the passed list (#77)
[4.0.0-rc.1] - 2021-12-28
Changed
Promise:finallyno longer observes a rejection from a Promise. CallingPromise:finallyis mostly transparent now.- The Promise returned by
Promise:finallyresolves or rejects with whatever the parent Promise resolved or rejected with. It will be cancelled if the parent Promise is cancelled. - The value returned from the
finallyhandler is discarded now. - If the value returned from the
finallyhandler is a Promise, we wait for it to resolve, but we do not use its value. - If the value returned from the
finallyhandler is a Promise and it rejects,finallyreturns the new rejected value.
- The Promise returned by
Promise:finallyno longer counts as a consumer of the parent Promise for cancellation purposes. If all consumers are cancelled and the only remaining callbacks are finally handlers, the Promise is now cancelled.- The Promise executor thread is now closed with
coroutine.closewhen the Promise is cancelled. - The Promise executor thread is now closed after the Promise settles (calling
resolveorreject). - Callbacks enqueued with
andThenandcatchare now dequeued if the Promise returned byandThen/catchis cancelled. - Calling
andThenorcatchon an already-cancelled Promise now returns a cancelled Promise instead of returning a rejected Promise :await,:expect, and:awaitStatusare no longer backed by BindableEvents, and now use the task library directly, so performance should be better.
roblox-lua-promise v3.2.1
[3.2.1] - 2022-01-02
Fixed
- Fix bug where Promise.fold does not return correct value if there is an unresolved Promise in the passed list (#77)
roblox-lua-promise v4.0.0 Release Candidate 1
[4.0.0-rc.1] - 2021-12-28
Changed
Promise:finallyno longer observes a rejection from a Promise. CallingPromise:finallyis mostly transparent now.- The Promise returned by
Promise:finallyresolves or rejects with whatever the parent Promise resolved or rejected with. It will be cancelled if the parent Promise is cancelled. - The value returned from the
finallyhandler is discarded now. - If the value returned from the
finallyhandler is a Promise, we wait for it to resolve, but we do not use its value. - If the value returned from the
finallyhandler is a Promise and it rejects,finallyreturns the new rejected value.
- The Promise returned by
Promise:finallyno longer counts as a consumer of the parent Promise for cancellation purposes. If all consumers are cancelled and the only remaining callbacks are finally handlers, the Promise is now cancelled.- The Promise executor thread is now closed with
coroutine.closewhen the Promise is cancelled. - The Promise executor thread is now closed after the Promise settles (calling
resolveorreject). - Callbacks enqueued with
andThenandcatchare now dequeued if the Promise returned byandThen/catchis cancelled. - Calling
andThenorcatchon an already-cancelled Promise now returns a cancelled Promise instead of returning a rejected Promise :await,:expect, and:awaitStatusare no longer backed by BindableEvents, and now use the task library directly, so performance should be better.
Removed
Promise:doneand its associated members have been removed.
roblox-lua-promise v3.2.0
[3.2.0] - 2021-12-27
Added
- Add
Promise.onUnhandledRejectionglobal event - Add
Promise.retryWithDelay
Changed
- Callable tables are now allowed anywhere that a function are allowed (
Promise.new,andThen, etc)
roblox-lua-promise v3.1.0
roblox-lua-promise v3.0.1
[3.0.1] - 2020-08-24
Fixed
roblox-lua-promise v3.0.0
[3.0.0] - 2020-08-17
Promise.delaynow usesos.clock- Made
Promise.delaybehavior more consistent when creating new timers in the callback of a timer.
[3.0.0-rc.3] - 2020-07-10
Fixed
- Fixed a bug where queued
andThenandcatchcallbacks did not begin on their own new threads.
[3.0.0-rc.1] - 2020-06-02
Changed
- Runtime errors are now represented by objects. You must call tostring on rejection values before assuming they are strings (this was always good practice, but is required now).
- Yielding is now allowed in
Promise.new,andThen, andPromise.tryexecutors. - Errors now have much better stack traces due to using
xpcallinternally instead ofpcall. - Stack traces will now be more direct and not include as many internal calls within the Promise library.
- Chained promises from
resolve()or returning from andThen now have improved rejection messages for debugging. Promise.asynchas been renamed toPromise.defer(Promise.asyncreferences same function for compatibility)- Promises now have a
__tostringmetamethod, which returnsPromise(Resolved)or whatever the current status is. Promise:timeout()now rejects with aPromise.Error(Promise.Error.Kind.TimedOut)object. (Formerly rejected with the string"Timed out")- Attaching a handler to a cancelled Promise now rejects with a
Promise.Error(Promise.Error.Kind.AlreadyCancelled). (Formerly rejected with the string"Promise is cancelled") - Let
Promise:expect()throw rejection objects
Added
- New Promise Error class is exposed at
Promise.Error, which includes helpful static methods likePromise.Error.is. - Added
Promise:now()(#23) - Added
Promise.each(#21) - Added
Promise.retry(#16) - Added
Promise.fromEvent(#14) - Improved test coverage for asynchronous and time-driven functions
Fixed
- Changed
Promise.isto be safe when dealing with tables that have an__indexmetamethod that creates an error. Promise.delayresolve value (time passed) is now more accurate (previously passed time based on when we started resuming threads instead of the current time. This is a very minor difference.)
roblox-lua-promise v3.0.0 Release Candidate 3
- Fixed a bug where queued
andThenandcatchcallbacks did not begin on their own new threads.
See RC 1 for full change list