Skip to content

Releases: timcassell/ProtoPromise

v3.0.2

12 Apr 08:37
d9f6d11
Compare
Choose a tag to compare

Fixes:

  • Fixed Promise.ParallelFor* canceling workers too early.
  • Promise.ParallelFor* and AsyncEnumerable.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

06 Apr 06:52
Compare
Choose a tag to compare

Fixes:

  • Fixed Promise<T>.IsValid when it was completed synchronously.

v3.0.0

18 Mar 20:10
cd28b24
Compare
Choose a tag to compare

Enhancements:

  • Added UnityEngine.Awaitable extensions to convert to Promise.
  • 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) and AsyncSemaphore.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 standard System.Action and System.Func<>.
  • Removed IRetainable interface.
  • AsyncReaderWriterLock upgrade key type changed from AsyncReaderWriterLock.WriterKey to AsyncReaderWriterLock.UpgradedWriterKey.
  • Proto.Promises.Async.CompilerServices namespace changed to Proto.Promises.CompilerServices.
  • PromiseMethodBuilder(<T>) types renamed to AsyncPromiseMethodBuilder(<T>).
  • Moved Proto.Promises.Extensions to Proto.Promises.TaskExtensions and Proto.Promises.CancellationTokenExtensions

v2.7.0

11 Feb 09:46
Compare
Choose a tag to compare

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 to AsyncReaderWriterLock.
  • Added Promise.ParallelForEachAsync APIs to consume AsyncEnumerable<T> and IAsyncEnumerable<T> in parallel.
  • Added new Progress APIs.
  • Added Promise.Finally overloads accepting Func<Promise> delegates to support DisposeAsync.
  • Added PromiseYielder.{WaitForUpdate, WaitForLateUpdate} APIs.

Fixes:

  • Fixed an exception in Unity after exiting playmode with reload domain disabled.
  • Fixed AsyncLocal<T> in Promise.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 new Progress APIs.

v2.6.1

22 Oct 03:16
9ff42d0
Compare
Choose a tag to compare

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

02 Oct 05:00
39b5bf9
Compare
Choose a tag to compare

Enhancements:

  • Added Promise.AllSettled and Promise.MergeSettled APIs.
  • Added message between causality stack traces (matches behavior of ExceptionDispatchInfo).

Fixes:

  • Fixed a NullReferenceException when PromiseYielder is used after OnApplicationQuit.
  • 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 faster Promise.ParallelFor.
  • Optimized PromiseSynchronizationContext.Post.
  • Other small miscellaneous performance improvements.

Deprecated:

  • Deprecated ResultContainer.Result, renamed to ResultContainer.Value.
  • Deprecated ResultContainer.RejectReason, renamed to ResultContainer.Reason.

v2.5.4

17 Jun 06:20
b8176c8
Compare
Choose a tag to compare

Fixes:

  • Fixed IndexOutOfRangeException when a PromiseYielder function is used more than 64 times simultaneously.

v2.5.3

09 Jun 23:53
de18e3c
Compare
Choose a tag to compare

Fixes:

  • Fixed circular await detection with Promise.ParallelForEach and Promise.ParallelFor.

Optimizations:

  • Reduced memory of CancelationSource.
  • Reduced memory of linked CancelationTokens.

v2.5.2

05 Jun 03:14
a791930
Compare
Choose a tag to compare

Fixes:

  • Fixed causality traces with Promise.ParallelForEach and Promise.ParallelFor.
  • Fixed circular await detection with Promise.ParallelForEach and Promise.ParallelFor.
  • Fixed Promise.Canceled() caused the parent promise to be mutated after it was repooled.

Optimizations:

  • Reduced memory and cpu of Promise.ParallelForEach and Promise.ParallelFor.
  • Reduced memory and cpu of Promise.Run.
  • Reduced memory and cpu of Promise.New.
  • Optimized internal context callbacks.

v2.5.1

27 May 04:15
11a6593
Compare
Choose a tag to compare

Fixes:

  • Included IL2CPP fixes in .Net Standard 2.1 nuget package.
  • Fixed a race condition with linked CancelationTokens when object pooling is enabled.
  • Fixed a race condition when Deferred.ReportProgress is called concurrently with Deferred.Resolve/Reject/Cancel.