protected override IStream <TOut> CreateOutputStream(GroupBySortedArgs <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.SortedGroup(args.Stream.SortDefinition.GetKey, (iS, firstElement) => args.SubProcess(new Stream <TIn>(new SubNodeWrapper(this), iS), firstElement).Observable); return(base.CreateUnsortedStream(outputObservable)); }
public GroupBySortedStreamNode(string name, GroupBySortedArgs <TIn, TKey, TOut> args) : base(name, args) { }