Reactive Extensions for Unity
Fix AsyncReactiveCommand constructor #365, thanks @TORISOUP Fix Build error of UniRx.Example Fix await behaviour of ReactiveProperty #419, thanks @TORISOUP
Other note, Added CircleCI UnitTest/Package Build https://circleci.com/gh/neuecc/UniRx
async/await
is separated to https://github.com/Cysharp/UniTask , if error is occured, remove package(clean) and re-import.
UniRx.Async
is separated to https://github.com/Cysharp/UniTask
This update is for Unity 2018.3(beta).
CancelletaionToken.RegisterWithoutCaptureExecutionContext
WWW
on Unity 2018.3UniRx.Async
on Unity 2018.3Improve cancellation/exception handling in UniRx.Async
.
All unhandled exception was routed to UniTaskScheduler.UnobservedTaskException
(called UniTask/UniTaskVoid.Forget
or when unhandled task was GCed)
OperationCanceledException
can modify to AwaiterStatus.Canceled
in async method and can ignore when routed to top.
New UniRx -> UniTaskTracker
editor window can detect async/await memory leak easily.
UniTask.Run
UniTask.SwitchToSynchronizationContext
UniTask.Lazy
UniTask.Void
UniTask.SwitchToMainThread
UniTask.SuppressCancellationThrow
CancellationTokenSource.CancelAfterSlim
CancellationTokenSource.RegisterRaiseCancelOnDestroy
Progress.CreateOnlyValueChanged
UniTaskScheduler(UnobservedTaskException/PropagateOperationCanceledException/UnobservedExceptionWriteLogType/DispatchUnityMainThread)
Task.AsUniTask(bool useCurrentSynchronizationContext)
ValueTuple
UniRx -> UniTaskTracker
editor windowDropdown.OnValueChangedAsync
Dropdown.OnValueChangedAsObservable
StackTrace.CleanupAsyncStackTrace
Exception.CleanupAsyncStackTrace
ReactiveProperty.WaitUntilValueChangedAsync(CancellationToken)
ReactiveCommand.WaitUntilExecuteAsync(CancellationToken)
AwaiterStatus.IsCompleted/IsCompletedSuccessfully/IsCanceled/IsFaulted
extension methodsUniTask.SwitchToThreadPool
does not yield correctlyUniTask.SwitchToTaskPool
does not yield correctlyIEnumerable[UniTask]
shortcut #336, thanks @ReqweldzenCanceled
status when throws OperationCanceledException
OperationCanceledException
when trigger was destroyedUniTaskScheduler.UnobservedTaskException
when unahandled task was GCedUniTask.WhenAll
UniTask.Yield
UniTask.ToString
shows statusUniTask.WithCancellation
is removed(use SuppressCancellationThrow
instead)Enumerable.Select(async x => { })
returns IEnumerable<UniTask<T>>
instead of IEnumerable<Task<T>>
button.OnInvokeAsync
-> button.OnClickAsync
AsyncUnityEventHandler.OnInvokeAsyncSuppressCancellationThrow
JobHandle
WWW
ReactiveProperty
ReactiveCommand
button.GetAsyncEventHandler
, button.OnCliCkAsync
, etc...)UniRx.Async.Triggers
)UniTask[T].ToCoroutine
UniTask.WaitUntil
UniTask.WaitWhile
UniTask.WaitUntilValueChanged
UniTask.WaitUntilValueChangedWithIsDestroyed
UniTask.SwitchToThreadPool
UniTask.SwitchToTaskPool
UniTask.ConfigureAwait
UniTask.WithCancellation
UniTask.FromCanceled
UniTask.Forget
UniTask.ContinueWith
Task.ConfigureAwait
UniTask.DelayFrame
UniTask.Delay(..., bool ignoreTimeScale = false, ...)
parameterAsyncEventHandler
that enables async/await based eventhandlingUniRx.Async.Triggers
that enables async/await based monobehaviour event handlingProgress.Create
that is lightweight Progress(no use SynchronizationContext) factoryUniRx.Async
UniRx.Async.Delay, DelayFrame, Wait, WaitUntil, WaitUntilValueChanged, WaitUntilValueChangedWithIsDestroyed
can reuse task to reduce garbageGetAwaiter
, ToUniTask
, ConfigureAwait
)UniTask[T].Timeout
cancellation handling more correctlyUniTask.Delay(int frameCount)
to UniTask.Delay(int millisecondsDelay)
Promise[T]
to UniTaskCompletionSource[T]
IPromise[T]
to IAwaiter[T]
IObservable[T].ToUniTask
UniTask[T].ToObservable
UniRx
ObjectPool.StartShrinkTimer
. #248, thanks @JoshuaLightUniRx.Async
module on Unity Incremental Compiler(C# 7.x)UniRx.Async
is custom async/await support instead of Task
.
This does not depend UniRx
so you can use separate UniRx.Async
package without UniRx
.
UniTask
, UniTask<T>
, UniTaskVoid
instead of Task
, Task<T>
and void
async/await
(uses C# 7.0 task-like feature)Task
and SynchronizationContext
, completely unity threading friendly and achives no-overhead, less garbageUniTask.Delay
, UniTask.Yield
, UniTask.Timeout
that is frame-based timer operators(no uses thread so works on WebGL publish) driven by custom PlayerLoop(Unity 2018 experimental feature)UniTask.WhenAll
, same as Task.WhenAll
but you can get awaited value by tuple deconsruction syntaxUniTask.WhenAny
, same as Task.WhenAny
but you can get which index winUniTask.ctor(Func<UniTask>)
is like the embeded AsyncLazy<T>
Promise<T>
is the lightweight edition of TaskCompletionSource<T>
, the API is same as EcmaScript's PromiseAsyncOperation
, ResourceRequest
, UnityWebRequestAsyncOperation
, IEnumerator
)Subject<T>
, current uses self iteration)ReactiveProperty.ctor(IObservable<T>)
overloadIObservable<T>.ToReactiveProperty
returns IReadOnlyReactiveProperty<T>
IEnumerable<T>.AsSafeEnumerable<T>
LazyTask<T>
UniRxSynchronizationContext
MainThreadDispatchType.AfterUpdate
ObservableMonoBehaviour
TypedMonoBehaviour
IPresenter
, PresenterBase
, PresenterBase<T>
This release is available in AssetStore on 2016-10-04
New Experimental support for Unity .NET 4.6 async/await
Add: ObserveEveryValueChanged(bool fastDestroyCheck) overload Add: Observable.Sample(intervalSourcea) overload, thanks @svermeulen Fix: UWP Platform compile error Breaking Changes: Remove workaround for Unity WWW dispose freeze bug
Unity 5.5.0xMono-Runtime-Upgrade-1-b4 Support details
use System.IObservable<T>, IObserver<T> instead of UniRx.IObservable<T>, IObserver<T> use System.Tuple instad of UniRx.Tuple (but lost ValueType tuple, should we create other tuple?) use System.IProgress<T> instead of UniRx.Progress use System.Threading.CancellationToken instead of UniRx.CancellationToken add GetAwaiter to UniRx for supports async/await for IObservable create UniRxSynchronizationContext to support async/await completly add ToObservable to Task supplemental Unity coroutine support async/await
This release is available in AssetStore on 2016-09-08 https://www.assetstore.unity3d.com/jp/#!/content/17276
Improvement: Support Unity 5.5 Beta Fix: ThrottleFirstFrame throws NullReferenceException when stream sends OnNext immediately. #160, thanks @hsanno Fix: Error on LogEntry.cs #164, thanks @kimsama Fix: ToReadOnlyReactiveProperty should be distinct publishing #161 Fix: To(ReadOnly)ReactiveProperty cause strange result when source observable returns OnCompleted or OnError (Breaking) Changes: PresenterBase was obsoleted(but it only commented, not marked [Obsolete]) Breaking Changes: Sample14 was removed Breaking Changes: Removed ObservableMonoBehaviour, TypedMonoBehaviour in UNITY 5.5 or newer
This release is available in AssetStore on 2016-08-01 https://www.assetstore.unity3d.com/jp/#!/content/17276
Add: Observable.FrameInterval
Add: Observable.FrameTimeInterval
Add: Observable.BatchFrame
Add: Observable.Debug(under UniRx.Diagnostics namespace)
Add: ObservableParticleTrigger and OnParticleCollisionAsObservable, OnParticleTriggerAsObservabl(after Unity 5.4) extension methods
Add: UniRx.AsyncReactiveCommand
Add: ReactiveCommand.BindToOnClick, IObservable<bool>.BindToButtonOnClick
Add: UniRx.Toolkit.ObjectPool, AsyncObjectPool
Add: UniRx.AsyncMessageBroker, asynchronous variation of MessageBroker
Add: ObserveEveryValueChanged(IEqualityComparer) overload
Add: Observable.FromCoroutine(Func<CancellationToken, IEnumerator>)
overload
Add: ObservableYieldInstruction.IsDone property
Add: IPresenter.ForceInitialize(object argument)
Improvement: Where().Select(), Select().Where() peformance was optimized that combine funcs at internal
Improvement: MicroCoroutine performance was optimized that prevent refresh spike
Improvement: Observable.Return performance was optimized that reduced memory cost
Improvement: Observable.Return(bool) was optimzied perofmrance that allocate zero memory
Improvement: Observable.ReturnUnit was optimzied perofmrance that allocate zero memory
Improvement: Observable.Empty was optimzied perofmrance that allocate zero memory
Improvement: Observable.Never was optimzied perofmrance that allocate zero memory
Improvement: Observable.DelayFrame performance was optimized
Improvement: UnityEqualityComparer.GetDefault peformance was optimized
Improvement: AddTo(gameObject) dispose when ObservableTrigger is not activated
Improvement: AddTo(gameObject/component) performance was optimized by use inner CompositeDisposable of ObservableDestroyTrigger
Improvement: FromCoroutine<T>(Func<IObserver<T>, IEnumerator>)
stops coroutine when subscription was disposed
Improvement: ReactiveCollection, ReactiveDictionary implements dispose pattern
Fix: ToYieldInstruction throws exception on MoveNext when reThrowOnError and has error
Fix: ObserveEveryValueChanged publish value immediately(this is degraded from UniRx 5.3)
Fix: Prevent warning on Unity 5.4 at ObservableMonoBehaviour/TypedMonoBehaviour.OnLevelWasLoaded
Fix: Remove indexer.set of IReadOnlyReactiveDictionary
Breaking Changes: Does not guaranty MicroCoroutine action on same frame
Breaking Changes: UniRx.Diagnostics.LogEntry was changed from class to struct for performance improvement