UniRx 에셋 추가

This commit is contained in:
Mingu Kim
2025-06-02 00:27:36 +09:00
parent 915f292d7d
commit 8a54d47b56
510 changed files with 42973 additions and 0 deletions

View File

@@ -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();
}
}
}
}