Asynchronous operations (promises) for Unity3d.
Promise
helper class with promise-specific helpers.ThenSequence
extensions.Done
promise extensions.LoadSceneAsync
extension method for AssetBundle
.AsyncUtility.LoadSceneAsync
helper.npm
support.await
support to YieldInstruction
Unity class.AsyncUtility.FromCoroutine
).AssetBundle
.AsyncUtility.FrameTime
await helper.DebuggerHidden
attribute to some properties/methods to make stack traces a bit more friendly.AsyncContinuationContext
to AsyncCallbackOptions
.Async
postfix to their names).UnityFx.Async.Extensions
namespace (previously they were in namespace UnityFx.Async
).null
result in cases when downloaded file failed to open.AsyncUtility.AddCompletionCallback
exception when adding new callbacks from another callback.AsyncUpdateSource
implementation to allow adding listeners from a callback.AsyncCompletionSource.SetProgress
implementation to allow setting progress when the operation is not started.IAsyncOperationCallbacks
methods to make the interface as minimalistic as possible (new extension methods are added to compensate).(Try)SetExceptions
methods/extensions and FromExceptions
helpers.Animation
class.WaitAsync
extension methods of the Animator
class.MovieTexture
support.AsyncResult
is now Task-like type and can be used as async
method result value (requires C# 7.2).AsyncResult.FromAction
overloads.SynchronizationContext
extension methods (PostAsync
, InvokeAsync
etc).Socket
, WebRequest
, Stream
BCL classes.UnityFx.Async.Extensions
(previously they were in namespace UnityFx.Async
).AsyncResult
completion callbacks to be called event if OnCompleted
throws.AsyncResult.FaultedOperation
and AsyncResult.CanceledOperation
.MovieTexture
helpers for iOS/Android (as it is not supported on mobiles).AsyncResultQueue
.AsyncLazy
.SetException
-like methods accepting as error message string.AsyncResult.DefaultSynchronizationContext
for more info.ConfigureAwait
extensions accepting continuation options instead of boolean flag.SynchronizationContext
extension methods for Send
/Post
accepting Action
as the delegate.AsyncResult.Yield
static method (workd exactly as Task.Yield
).AsyncUtility.AddFrameCallback
helper for scheduling delegates for MonoBehaviour
update loop.IAsyncOperationEvents
methods to the interface extensions.AsyncLazy
interface.AsyncOperationResult
.WWW
support for Unity 2018.3+ (it has been deprecated in Unity).Play
/Wait
extension methods for Animation
and Animator
.AsyncResult.IsStarted
helper property.AsyncResult
constructors argument order to avoid ambiguity in some cases.AsyncUtility
to AsyncWww
class.AsyncUtility.SendToMainThread
, AsyncUtility.PostToMainThread
and AsyncUtility.InvokeOnMainThread
implementation to use ConcurrentQueue
for net46+ to avoid unnesesary locks.AsyncResultQueue
.IAsyncOperationEvents.TryAddCompletionCallback
and IAsyncOperationEvents.TryAddProgressCallback
methods. These methods are not needed in 99% of cases and may lead to logic errors in multi-threaded environment.IAsyncOperation.Id
property for easy operation identification.AsyncUtility.GetText
and AsyncUtility.GetBytes
helpers.ToTask
extensions for AsyncOperation
/UnityWebRequest
/WWW
.AsyncResult
now implements AsyncContinuation
to enable easy operation chaining.ToAsyncXxx
extension methods for WWW
and UnityWebRequest
.MovieTexture
related methods for Unity 2018.2 (the class is deprecated now).IAsyncSchedulable
interface (it was just another form of IAsyncContinuation
).AsyncResult.FaultedOperation
helper.AsyncUtility.IsMainThread
method.AsyncUtility.GetAssetBundle
, AsyncUtility.GetTexture
, AsyncUtility.AudioClip
and AsyncUtility.GetMovieTexture
helper methods.AssetBundleCreateRequest
wrapper operation.ThrowIfNonSuccess
extension for IAsyncOperation
.ToEnum
extension for IAsyncResult
that converts an asynchronous operation (Task
, AsyncResult
etc) to enumerator.IAsyncSchedulable
interface - an abstraction of a schedulable entity.AsyncLazy
helper for initialization operations.AggregateException
class for net35.AsyncResult.Delay(float)
overloads.AsyncCreationOptions.SuppressCancellation
option.LateUpdate
, FixedUpdate
and end-of-frame updates.SynchronizationContext
for the main thread (if not set by Unity).AsyncUtility.PostToMainThread
, AsyncUtility.SendToMainThread
as AsyncUtility.InvokeOnMainThread
.FromAction
overloads.IAsyncContinuation.Invoke
method.AsyncResult.OnCancel
implementation to do nothing (previously it threw NotSupportedException
).AsyncUpdateSource.OnError
/ AsyncUpdateSource.OnCompleted
/ AsyncUpdateSource.Dispose
.AsyncResult.MoveNext
to always return true
while the operation is not completed.AsyncResult
construction code not working as intended when AsyncCreationOptions
are specified.AsyncOperationCallback
delegate type.