v2.3.0
Enhancements:
- Added
Promise.Wait()
andPromise<T>.WaitForResult()
synchronous APIs. CancelationRegistration
now implementsIDisposable
andIAsyncDisposable
interfaces. Disposing the registration will unregister the callback, or wait for the callback to complete if it was already invoked.- Added
CancelationToken.GetRetainer()
API to reduceTryRetain
/Release
boilerplate code. - Un-deprecated
Deferred.IsValid
, and changed it to return whether theDeferred.Promise
is valid, instead of returningDeferred.IsValidAndPending
.
Fixes:
- Fixed
PromiseYielder
when different runners are used on a re-used routine. - Fixed
NullReferenceException
when the AppDomain is unloaded.
Deprecated:
- deprecated
Promise.ResultContainer.RejectContainer
, replaced withPromise.ResultContainer.RejectReason
. - deprecated
CancelationToken.Retain()
(preferTryRetain()
). - deprecated
CancelationRegistration.Unregister()
(preferTryUnregister()
orDispose()
).
Misc:
CancelationToken.Register(callback)
now returns a default registration if it failed to register instead of throwing.
Breaking Changes:
- Removed
Promise<T>.RaceWithIndex
andPromise<T>.FirstWithIndex
APIs in build targets older than .Net Standard 2.1.Promise.RaceWithIndex<T>
andPromise.FirstWithIndex<T>
APIs can be used instead.