protected override IStream <TOut> CreateOutputStream(CrossApplyArgs <TIn, TOut> args) { if (args.NoParallelisation) { return(base.CreateUnsortedStream(args.Stream.Observable.MultiMap <TIn, TOut>( (TIn i, Action <TOut> push) => args.ValuesProvider.PushValues(i, push, args.Stream.Observable.CancellationToken, base.ExecutionContext.DependencyResolver, base.ExecutionContext)))); } else { var synchronizer = new Synchronizer(); return(base.CreateUnsortedStream(args.Stream.Observable.FlatMap((i, ct) => { return new DeferredPushObservable <TOut>((push, c) => { using (synchronizer.WaitBeforeProcess()) args.ValuesProvider.PushValues(i, push, c, base.ExecutionContext.DependencyResolver, base.ExecutionContext); }, ct); }))); } }
public CrossApplyStreamNode(string name, CrossApplyArgs <TIn, TOut> args) : base(name, args) { }