All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog; this project adheres to Semantic Versioning.
- Added
Promise
helper class with promise-specific helpers. - Added
ThenSequence
extensions. - Added unhandled exception event for
Done
promise extensions. - Added
LoadSceneAsync
extension method forAssetBundle
. - Added
AsyncUtility.LoadSceneAsync
helper. - Added
npm
support.
- Fixed build issue for Unity 2018.3.
- Fixed
AsyncUtility.FrameUpdate
not scheduling the callback.
NOTE: NuGet-only release instead of not published v1.0.0.
- Deprecated all
Task
-related extension methods. They are considered out of the library scope.
- Added more comments throughout the code.
- Added Unity 2018.3 support (esp. support all target .NET frameworks in a single Asset Store package).
- Added
await
support toYieldInstruction
Unity class. - Added coroutine helpers (
AsyncUtility.FromCoroutine
). - Added helpers for loading assets from an
AssetBundle
. - Added
AsyncUtility.FrameTime
await helper.
- Added
DebuggerHidden
attribute to some properties/methods to make stack traces a bit more friendly. - Renamed
AsyncContinuationContext
toAsyncCallbackOptions
. - Renamed web request helper methods (added
Async
postfix to their names). - Moved Unity extension methods to
UnityFx.Async.Extensions
namespace (previously they were in namespaceUnityFx.Async
).
- Fixed web requests
null
result in cases when downloaded file failed to open. - Fixed
AsyncUtility.AddCompletionCallback
exception when adding new callbacks from another callback. - Fixed
AsyncUpdateSource
implementation to allow adding listeners from a callback. - Fixed
AsyncCompletionSource.SetProgress
implementation to allow setting progress when the operation is not started.
- Removed many specialized
IAsyncOperationCallbacks
methods to make the interface as minimalistic as possible (new extension methods are added to compensate). - Removed
(Try)SetExceptions
methods/extensions andFromExceptions
helpers. - Removed extension methods of the
Animation
class. - Removed
WaitAsync
extension methods of theAnimator
class. - Dropped
MovieTexture
support.
AsyncResult
is now Task-like type and can be used asasync
method result value (requires C# 7.2).- Added new
AsyncResult.FromAction
overloads. - Added new
SynchronizationContext
extension methods (PostAsync
,InvokeAsync
etc). - Added extension methods for
Socket
,WebRequest
,Stream
BCL classes.
- Moved BCL extension methods to namespace
UnityFx.Async.Extensions
(previously they were in namespaceUnityFx.Async
).
- Fixed
AsyncResult
completion callbacks to be called event ifOnCompleted
throws. - Fixed exception not been set for
AsyncResult.FaultedOperation
andAsyncResult.CanceledOperation
. - Disabled
MovieTexture
helpers for iOS/Android (as it is not supported on mobiles).
- Removed
AsyncResultQueue
. - Removed
AsyncLazy
.
- Added convenience overloads for
SetException
-like methods accepting as error message string. - Added allocation optimizations for single-threaded applications (particularly for Unity3d). See
AsyncResult.DefaultSynchronizationContext
for more info. - Added new overloads for
ConfigureAwait
extensions accepting continuation options instead of boolean flag. - Added
SynchronizationContext
extension methods forSend
/Post
acceptingAction
as the delegate. - Added
AsyncResult.Yield
static method (workd exactly asTask.Yield
). - Added
AsyncUtility.AddFrameCallback
helper for scheduling delegates forMonoBehaviour
update loop. - Signed the assembly with a strong name.
- Added performance benchmarks.
- Added sandbox Unity project.
- Moved several of
IAsyncOperationEvents
methods to the interface extensions. - Simplified
AsyncLazy
interface.
- Fixed error handling in
AsyncOperationResult
.
- Removed Asset Store samples.
- Dropped Unity 5.0 support (the minimum version supported is now 5.4).
- Dropped
WWW
support for Unity 2018.3+ (it has been deprecated in Unity).
- Added
Play
/Wait
extension methods forAnimation
andAnimator
. - Added
AsyncResult.IsStarted
helper property.
- Changed
AsyncResult
constructors argument order to avoid ambiguity in some cases. - Moved the package content to Plugins folder and remove assembly definition file.
- Moved web request related helpers from
AsyncUtility
toAsyncWww
class. - Changed
AsyncUtility.SendToMainThread
,AsyncUtility.PostToMainThread
andAsyncUtility.InvokeOnMainThread
implementation to useConcurrentQueue
for net46+ to avoid unnesesary locks. - Changed interface of
AsyncResultQueue
.
- Removed
IAsyncOperationEvents.TryAddCompletionCallback
andIAsyncOperationEvents.TryAddProgressCallback
methods. These methods are not needed in 99% of cases and may lead to logic errors in multi-threaded environment.
- Added
IAsyncOperation.Id
property for easy operation identification. - Added
AsyncUtility.GetText
andAsyncUtility.GetBytes
helpers. - Added
ToTask
extensions forAsyncOperation
/UnityWebRequest
/WWW
. AsyncResult
now implementsAsyncContinuation
to enable easy operation chaining.
- Fixed compile warnings for Unity 2018.2.
- Removed
ToAsyncXxx
extension methods forWWW
andUnityWebRequest
. - Removed
MovieTexture
related methods for Unity 2018.2 (the class is deprecated now). - Removed
IAsyncSchedulable
interface (it was just another form ofIAsyncContinuation
).
- Added assembly definition file for Unity 2017.3+.
- Added
AsyncResult.FaultedOperation
helper. - Added
AsyncUtility.IsMainThread
method. - Added
AsyncUtility.GetAssetBundle
,AsyncUtility.GetTexture
,AsyncUtility.AudioClip
andAsyncUtility.GetMovieTexture
helper methods. - Added
AssetBundleCreateRequest
wrapper operation. - Added
ThrowIfNonSuccess
extension forIAsyncOperation
. - Added
ToEnum
extension forIAsyncResult
that converts an asynchronous operation (Task
,AsyncResult
etc) to enumerator. - Added
IAsyncSchedulable
interface - an abstraction of a schedulable entity. - Added
AsyncLazy
helper for initialization operations.
- Fixed compile warnings for some older Unity versions.
- Fixed error handling for Unity operation wrappers.
- Removed
AggregateException
class for net35.
- Added push-based progress reporting support.
- Added
AsyncResult.Delay(float)
overloads. - Added
AsyncCreationOptions.SuppressCancellation
option. - Added update sources for
LateUpdate
,FixedUpdate
and end-of-frame updates. - Added
SynchronizationContext
for the main thread (if not set by Unity). - Added methods
AsyncUtility.PostToMainThread
,AsyncUtility.SendToMainThread
asAsyncUtility.InvokeOnMainThread
. - Added new
FromAction
overloads.
- Significantly reduced number of memory allocations when adding continuations.
- Changed signature of the
IAsyncContinuation.Invoke
method. - Changed
AsyncResult.OnCancel
implementation to do nothing (previously it threwNotSupportedException
).
- Fixed exception when removing listeners while in
AsyncUpdateSource.OnError
/AsyncUpdateSource.OnCompleted
/AsyncUpdateSource.Dispose
. - Fixed
AsyncResult.MoveNext
to always returntrue
while the operation is not completed. - Fixed
AsyncResult
construction code not working as intended whenAsyncCreationOptions
are specified.
- Removed
AsyncOperationCallback
delegate type.
- Added pull-based progress reporting support.
- Added new methods to
IAsyncUpdateSource
. - Added
AsyncUpdateSource
class as defaultIAsyncUpdateSource
implementation. IAsyncOperation<T>
now inheritsIObservable<T>
.
- Changed
IAsyncOperation.Exception
type toException
. - Changed
IAsyncOperationEvents.Completed
type toAsyncCompletedEventHandler
.
- Removed
ToObservable
extension ofIAsyncOperation
.
- Fixed Unity3d script compile errors when targeting .NET 4.x (Issue #1).
- Added
AsyncContinuationOptions
. - Added
AsyncCreationOptions
. - Added
Promise
-like extensionsThen
,ThenAll
,ThenAny
,Rebind
,Catch
,Finally
andDone
. - Added
Unwrap
extension methods. - Added
FromTask
/FromObservable
helpers. - Added
FromAction
helpers. - Added
ToAsync
extension method forIObservable
interface. - Added
TryAddContinuation
/RemoveContinuation
methods toIAsyncOperationEvents
for non-delegate continuations. - Added
IAsyncUpdatable
andIAsyncUpdateSource
interfaces. - Added
Delay
/Retry
overload that usesIAsyncUpdateSource
-based service for time management. - Added cancellation support (
IAsyncCancellable
interface,WithCancellation
extension method and many implementation changes). - Added
Wait
/Join
overloads withCancellationToken
argument.
- Changed
ContinueWith
extension signatures to match correspondingTask
methods. - Changed
IAsyncOperation.Exception
to always return an exception instance if completed with non-success. - Changed
AddCompletionCallback
/AddContinuation
to instance methods (instead of extensions).
- Fixed exception not initialized properly for canceled operations sometimes.
- Removed
GetAwaiter
/ConfigureAwait
instance methods fromAsyncResult
to avoid code duplication (extension methods should be used). - Removed all
AsyncCompletionSource
methods havingcompletedSynchronously
argument.
- New
AsyncResult
constructors added. - New overloads for
AsyncResult.FromResult
,AsyncResult.FromCanceled
andAsyncResult.FromException
methods added.
- Made optimizations to
ToTask
extensions implementation for cases when target operation is completed. - Marked all assembly classes CLS-compilant.
ToTask
extensions now throw inner exception instead of theAggregateException
in case of an error.- Fixed
AsyncResult.Delay
throwing exception when infinite delay (-1) specified.
- Added
AsyncResultQueue.Empty
event. - Added
Unity
-specific tools for Asset Store.
- Added
IAsyncCompletionSource.Operation
property to matchTaskCompletionSource
interface. - Added new constructor to
AsyncResult
. - Added
AsyncResult.Start
method to matchTask
interface. - Added
AsyncResult.OnStarted
virtual method. - Added
WhenAll
/WhenAny
static helpers forAsyncResult
. - Added
ConfigureAwait
extensions forIAsyncOperation
. - Added
Task
extension methods to that convert it to anAsyncResult
instance. - Added
AsyncResult.Retry
methods. - Added
Wait
overloads to matchTask
interface.
- Removed
AsyncResult.TryCreateAsyncWaitHandle
helper.
- Modified
AsyncResultAwaiter
implementation to throw if the operation was canceled or faulted (to matchTaskAwaiter
behaviour). - Implemented
AsyncCompletionSource
as a sealed analog ofTaskCompletionSource
. - Removed public completion methods from
AsyncResult
(moved them toAsyncCompletionSource
). - Made
SpinUntilCompleted
an extension method (wasAsyncResult
instance method). - Changed
IAsyncOperation.Exception
type toAggregateException
to matchTask
. - Changed
IAsyncOperationEvents.Completed
event signature & behaviour to always execute handler (event if it was registered after the comperation has copleted). - Removed
AsyncResult
constructors that accepted exceptions. - Changed
AsyncResult.Result
property to throwAggregateException
when faulted or canceled to mathchTask
behaviour.
AsyncResultQueue
now does not remove uncompleted operations from the queue.AsyncResult.Exception
now only returns non-null value when the operation is faulted.
- Added possibility to store multiple exceptions in
AsyncResult
. - Added
AggregateException
class fornet35
target. - Added
IsEmpty
property toAsyncResultQueue
.
AsyncResult
implemenation is changed to prevent returning null operation result when the operation is completed in some cases.
- Added project documentation site (
docs
folder). - Added unit tests project.
- Added continuations support.
- Added AppVeyor CI support.
- Added NuGet deployment.
- Added GitVersion support.
- Renamed
AsyncOperationStatus
values to match TastStatus.
- Initial release.