Skip to content

v3.3.0

Latest
Compare
Choose a tag to compare
@timcassell timcassell released this 27 Jan 20:25
· 1 commit to master since this release

Enhancements:

  • Added Proto.Timers.
    • Timer and TimerFactory
  • Added Promise.Delay APIs.
  • Added Promise(<T>).WaitAsync APIs with timeouts.
  • Added delayed cancelation APIs to CancelationSource.
    • CancelationSource.New(TimeSpan, (optional) TimerFactory, (optional) linked token(s))
    • CancelationSource.CancelAfter(TimeSpan)
  • Added CancelationToken(bool) constructor.
  • Added CancelationToken.RegisterWithoutImmediateInvoke APIs.
  • Added PromiseYielder.Initialize() API to help with early code running before Unity can auto initialize.

Fixes:

  • Fixed Unity initialization not being fully initialized before user Awake methods run.

Optimizations:

  • Promise(<T>).ConfigureAwait(ContinuationOptions) consumes zero memory if Promise.Config.AsyncFlowExecutionContextEnabled is disabled (which is the default state).
  • Reduced memory of async Promise(<T>).
  • Reduced memory of async synchronization primitives
  • Reduced memory of Promise.ParallelFor* APIs.
  • Reduced memory of Channels.
  • Optimized object pool contention.
  • Internally avoid cost of zeroing types that contain no references.
  • Split Promise(<T>).ContinueWith methods without a CancelationToken parameter to avoid the cost of the token when it's not needed.
  • Reduced memory and increased speed of AsyncLazy<T> when the factory is invoked.
  • No longer pool memory allocated from AsyncLazy<T>.

Deprecated:

  • Promise(<T>).{Then, Catch, CatchCancelation} APIs accepting a CancelationToken parameter. (Prefer WaitAsync followed by the same API without the token.)
  • Deprecated CancelationSource.{IsValid, TryCancel, TryDispose}. (Prefer != default and methods without Try prefix.)
  • Deprecated CancelationToken.{TryRegister, TryRegisterWithoutImmediateInvoke}. (Prefer CanBeCanceled and methods without Try prefix.)
  • Deprecated Promise(<T>).Deferred.{IsValid*, Try*} APIs. (Prefer != default.)
  • Deprecated Promise(<T>).IsValid.

Misc:

  • Changed behavior of CancelationSource.Cancel to not throw if it's called more than once.
  • Changed behavior of CancelationSource, Promise(<T>).Deferred, Channel(Reader/Writer) to throw NullReferenceException if it's default.