架构大更
This commit is contained in:
@@ -4,7 +4,7 @@ namespace UniRx.Operators
|
||||
{
|
||||
internal class MaterializeObservable<T> : OperatorObservableBase<Notification<T>>
|
||||
{
|
||||
readonly IObservable<T> source;
|
||||
private readonly IObservable<T> source;
|
||||
|
||||
public MaterializeObservable(IObservable<T> source)
|
||||
: base(source.IsRequiredSubscribeOnCurrentThread())
|
||||
@@ -17,9 +17,9 @@ namespace UniRx.Operators
|
||||
return new Materialize(this, observer, cancel).Run();
|
||||
}
|
||||
|
||||
class Materialize : OperatorObserverBase<T, Notification<T>>
|
||||
private class Materialize : OperatorObserverBase<T, Notification<T>>
|
||||
{
|
||||
readonly MaterializeObservable<T> parent;
|
||||
private readonly MaterializeObservable<T> parent;
|
||||
|
||||
public Materialize(MaterializeObservable<T> parent, IObserver<Notification<T>> observer, IDisposable cancel)
|
||||
: base(observer, cancel)
|
||||
@@ -40,13 +40,27 @@ namespace UniRx.Operators
|
||||
public override void OnError(Exception error)
|
||||
{
|
||||
observer.OnNext(Notification.CreateOnError<T>(error));
|
||||
try { observer.OnCompleted(); } finally { Dispose(); }
|
||||
try
|
||||
{
|
||||
observer.OnCompleted();
|
||||
}
|
||||
finally
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
}
|
||||
|
||||
public override void OnCompleted()
|
||||
{
|
||||
observer.OnNext(Notification.CreateOnCompleted<T>());
|
||||
try { observer.OnCompleted(); } finally { Dispose(); }
|
||||
try
|
||||
{
|
||||
observer.OnCompleted();
|
||||
}
|
||||
finally
|
||||
{
|
||||
Dispose();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user