protected override IStream <TOut> CreateOutputStream(GroupByArgs <TIn, TKey, TOut> args) { if (this.ExecutionContext is GetDefinitionExecutionContext) { var inputStream = new SingleStream <TIn>(new SubNodeWrapper(this), PushObservable.FromSingle(default(TIn), null, args.Stream.Observable.CancellationToken)); var outputStream = args.SubProcess(inputStream, default); this.ExecutionContext.AddNode(this, outputStream.Observable); } var outputObservable = args.Stream.Observable.Group(args.GetKey, (iS, firstElement) => args.SubProcess(new Stream <TIn>(new SubNodeWrapper(this), iS), firstElement).Observable); return(base.CreateUnsortedStream(outputObservable)); }
public GroupByStreamNode(string name, GroupByArgs <TIn, TKey, TOut> args) : base(name, args) { }