public void Subscribe(ICompletableSubscriber s) { var oo = new OtherObserver(s, source); s.OnSubscribe(oo); oo.SetResource(other.Subscribe(oo)); }
public Demo() { var boss = new Boss(); var stockObserver = new StockObserver("小魏", boss); var nbaObserver = new NbaObserver("小易", boss); var otherObserver = new OtherObserver(); boss.Update += stockObserver.CloseStockMarket; boss.Update += nbaObserver.CloseNbaDirectSeeding; boss.Update += otherObserver.Other; boss.SubjectState = "我胡汉三回来了"; //boss.Update -= stockObserver.CloseStockMarket; boss.Notify(); }
public IDisposable Run(SkipUntil <TSource, TOther> parent) { var sourceObserver = new SourceObserver(this); var otherObserver = new OtherObserver(this, sourceObserver); var otherSubscription = parent._other.SubscribeSafe(otherObserver); var sourceSubscription = parent._source.SubscribeSafe(sourceObserver); sourceObserver.Disposable = sourceSubscription; otherObserver.Disposable = otherSubscription; return(StableCompositeDisposable.Create( sourceSubscription, otherSubscription )); }
public IDisposable Run(TakeUntil <TSource, TOther> parent) { var sourceObserver = new SourceObserver(this); var otherObserver = new OtherObserver(this, sourceObserver); // COMPAT - Order of Subscribe calls per v1.0.10621 var otherSubscription = parent._other.SubscribeSafe(otherObserver); otherObserver.Disposable = otherSubscription; var sourceSubscription = parent._source.SubscribeSafe(sourceObserver); return(StableCompositeDisposable.Create( otherSubscription, sourceSubscription )); }
public TakeUntilObserver(ICompletableObserver downstream) { this.downstream = downstream; this.other = new OtherObserver(this); }
public TakeUntilObserver(IMaybeObserver <T> downstream) { this.downstream = downstream; this.other = new OtherObserver(this); }
public TakeUntilMainObserver(ISignalObserver <T> downstream) { this.downstream = downstream; this.other = new OtherObserver(this); }
public MainObserver(ISignalObserver <T> downstream, IObservableSource <T> source) { this.downstream = downstream; this.other = new OtherObserver(this, source); }