Releases: timcassell/ProtoPromise
Releases · timcassell/ProtoPromise
v3.2.0
Enhancements:
- Added
Channel<T>
and related types inProto.Promises.Channels
namespace. - Added
Promise(<T>).{ConfigureAwait, ConfigureContinuation}
APIs and accompanyingContinuationOptions
type. - Added
SynchronizationOption.CapturedContext
option. - Added
(Ordered, Configured)AsyncEnumerable.ConfigureAwait(ContinuationOptions)
new overloads. - Exposed
ConfiguredAsyncEnumerable<T>.{ContinuationOptions, CancelationToken}
andConfiguredAsyncEnumerable<T>.Enumerator.ContinuationOptions
. - Added
ManualSynchronizationContextCore
type. - Added
PromiseSynchronizationContext.Execute(bool exhaustive)
API. - Added
Promise(<T>).FromException
API. - Added option to disable context capture for async synchronization primitives.
Fixes:
- Fixed some bugs surrounding
AsyncEnumerable.Merge
enumerator disposal. - Fixed a potential race condition with
Promise.New
API. - Fixed some async Linq implementations that weren't configuring the awaits properly.
Deprecated:
- Deprecated
Promise(<T>).WaitAsync
APIs acceptingSynchronizationContext
andSynchronizationOption
.
Misc:
- Changed default
Progress
invokeOption toCapturedContext
. - Added net8.0 build target.
v3.1.1
Fixes:
- Fixed a race condition with
Promise.AsValueTask()
.
v3.1.0
Enhancements:
- Added structured concurrency promise groups.
- Added
Promise(<T>).Each
APIs. - Added
Promise(<T>).GetRetainer
APIs. - Added nuget configuration override.
Fixes:
- Fixed some
Promise.AllSettled<T>
APIs. - Fixed circular await detection with
AsyncEnumerable.Merge
APIs.
Deprecated:
- Deprecated
Promise(<T>).{Preserve, Duplicate}
APIs.
v3.0.2
Fixes:
- Fixed
Promise.ParallelFor*
canceling workers too early. Promise.ParallelFor*
andAsyncEnumerable.Merge
propagate exceptions from cancelation token callbacks instead of deadlocking.
Misc:
AsyncEnumerable.Merge
more eagerly stops iteration if a rejection or cancelation occurs.
v3.0.1
Fixes:
- Fixed
Promise<T>.IsValid
when it was completed synchronously. - Fixed nuget package causing build errors in .Net Framework.
v3.0.0
Enhancements:
- Added
UnityEngine.Awaitable
extensions to convert toPromise
. - Added overloads accepting
ReadOnlySpan<T>
parameter.CancelationSource.New
AsyncEnumerable<T>.Merge
Promise(<T>).{All(Settled), Race(WithIndex), First(WithIndex)}
- Added
CancelationToken.TryRegisterWithoutImmediateInvoke<TCancelable>
API. - Added
AsyncSemaphore.EnterScopeAsync(CancelationToken)
andAsyncSemaphore.EnterScope(CancelationToken)
overloads.
Fixes:
- Enumerator is properly disposed in
Promise.ParallelForEach
.
Optimizations:
- Improved performance and reduced memory of promises and types that use promises.
- Async synchronization primitives use spin lock instead of full Monitor lock.
Breaking Changes:
- Removed support for runtimes older than .Net Standard 2.0.
- Removed deprecated and useless APIs.
Deferred.{(Try)ReportProgress, (Try)Cancel, State, Retain, Release, New(CancelationToken)}
Promise.{Progress, AwaitWithProgress, NewDeferred(CancelationToken), Wait(TimeSpan), Retain, Release, New<T>, New<TCapture, T>, Rejected<T, TReject>, Canceled<TCancel>, Canceled<T, TCancel>, CancelException<T>}
Promise<T>.{WaitForResult(TimeSpan, out T), Retain, Release, AllNonAlloc, Canceled<TCancel>, NewDeferred(CancelationToken)}
CanelationRegistration.Unregister
CancelationSource.(Try)Cancel<TReason>
CancelationToken.{Retain, CancelationValueType, CancelationValue, TryGetCancelationValueAs<T>}
PoolType
Promise.Config.{ObjectPooling, WarningHandler}
Promise.Manager.{HandleCompletes, HandleCompletesAndProgress, HandleProgress, LogWarning}
ReasonContainer
Promise.ResultContainer.{RejectReason, RejectContainer, CancelContainer}
Promise<T>.ResultContainer.{Result, RejectReason, RejectContainer, CancelContainer}
AsyncMonitor.{WaitAsync(AsyncLock.Key, CancelationToken), Wait(AsyncLock.Key, CancelationToken)}
PromiseYielder.WaitOneFrame(MonoBehaviour)
UnhandledException.{ValueType, TryGetValueAs<T>}
CanceledException.{ValueType, Value, TryGetValueAs<T>}
- Removed
Promise(<T>).{ContinueFunc, ContinueAction}
delegates. Promise(<T>).ContinueWith
parameter delegate types changed to standardSystem.Action
andSystem.Func<>
.- Removed
IRetainable
interface. AsyncReaderWriterLock
upgrade key type changed fromAsyncReaderWriterLock.WriterKey
toAsyncReaderWriterLock.UpgradedWriterKey
.Proto.Promises.Async.CompilerServices
namespace changed toProto.Promises.CompilerServices
.PromiseMethodBuilder(<T>)
types renamed toAsyncPromiseMethodBuilder(<T>)
.- Moved
Proto.Promises.Extensions
toProto.Promises.TaskExtensions
andProto.Promises.CancellationTokenExtensions
v2.7.0
Enhancements:
- Added
AsyncEnumerable<T>
allocation-free async iterators (requires C# 7.3 or newer). - Added allocation-free async Linq extensions for
AsyncEnumerable<T>
. - Added optional
ContentionStrategy
toAsyncReaderWriterLock
. - Added
Promise.ParallelForEachAsync
APIs to consumeAsyncEnumerable<T>
andIAsyncEnumerable<T>
in parallel. - Added new
Progress
APIs. - Added
Promise.Finally
overloads acceptingFunc<Promise>
delegates to supportDisposeAsync
. - Added
PromiseYielder.{WaitForUpdate, WaitForLateUpdate}
APIs.
Fixes:
- Fixed an exception in Unity after exiting playmode with reload domain disabled.
- Fixed
AsyncLocal<T>
inPromise.Parallel*
body. - Fixed an error log when clearing the object pool in a rare case.
Optimizations:
- Improved performance of
async Promise
functions in netstandard2.1 and Unity 2021.2 or newer.
Deprecated:
- Deprecated old progress APIs (
Deferred.ReportProgress
,Promise.Progress
,Promise.AwaitWithProgress
). Replaced with newProgress
APIs.
v2.6.1
Fixes:
- Fixed compilation error in RELEASE mode in Unity 2020.1 or newer.
- Fixed
PromiseYielder.WaitOneFrame().ToPromise()
waits an extra frame in Unity versions older than 2021.2.
Optimizations:
- Fixed spin waits for some synchronous operations.
v2.6.0
Enhancements:
- Added
Promise.AllSettled
andPromise.MergeSettled
APIs. - Added message between causality stack traces (matches behavior of
ExceptionDispatchInfo
).
Fixes:
- Fixed a
NullReferenceException
whenPromiseYielder
is used afterOnApplicationQuit
. - Fixed a race condition with progress.
- Fixed a race condition with cancelations (was not an issue in RELEASE mode).
- Fixed causality trace not being preserved when a progress callback is invoked synchronously from an already resolved promise.
Optimizations:
- Fixed PromiseMethodBuilders allocating in tier0 jit.
- Object pool uses pointers for clear event instead of delegates in C# 9.
- Use
Interlocked
instead of lock for fasterPromise.ParallelFor
. - Optimized
PromiseSynchronizationContext.Post
. - Other small miscellaneous performance improvements.
Deprecated:
- Deprecated
ResultContainer.Result
, renamed toResultContainer.Value
. - Deprecated
ResultContainer.RejectReason
, renamed toResultContainer.Reason
.
v2.5.4
Fixes:
- Fixed
IndexOutOfRangeException
when aPromiseYielder
function is used more than 64 times simultaneously.