[Add] UniRX

V7.1.0
This commit is contained in:
2026-05-27 03:26:36 +07:00
parent 73dee3a113
commit 9d28d1bc39
506 changed files with 42627 additions and 0 deletions
@@ -0,0 +1,33 @@
using System;
using System.Threading;
namespace UniRx.Operators
{
public abstract class OperatorObserverBase<TSource, TResult> : IDisposable, IObserver<TSource>
{
protected internal volatile IObserver<TResult> observer;
IDisposable cancel;
public OperatorObserverBase(IObserver<TResult> observer, IDisposable cancel)
{
this.observer = observer;
this.cancel = cancel;
}
public abstract void OnNext(TSource value);
public abstract void OnError(Exception error);
public abstract void OnCompleted();
public void Dispose()
{
observer = UniRx.InternalUtil.EmptyObserver<TResult>.Instance;
var target = System.Threading.Interlocked.Exchange(ref cancel, null);
if (target != null)
{
target.Dispose();
}
}
}
}