如果P.DoWork()依赖于d1.DoWork()和d2.DoWork()的完成:
p.Dependencies.ToObservable()
.SelectMany(
x=>Observable.Return(x)
.SubscribeOn(NewThreadScheduler.Default)
.Select(a => a.Dowork())
)
.Subscript(_={},()=p.DoWork())
将p.DoWork()放入onComplete:
var po =Observable.Return(p)
.SubscribeOn(NewThreadScheduler.Default)
.Select(a => a.Dowork());
var ds = p.Dependencies.ToObservable()
.SelectMany(
x=>Observable.Return(x)
.SubscribeOn(NewThreadScheduler.Default)
.Select(a => a.Dowork())
);
ds.Concat(po).subscribe();
或使用Concat:
AudioGraph
同样的?