Beispiel #1
0
        protected override IStream <TOut> CreateOutputStream(ReKeyArgs <TIn, TOut, TMultiKey> args)
        {
            var keyProcessor  = GroupProcessor.Create(args.GetKeys);
            var observableOut = args.InputStream.Observable.Do(keyProcessor.ProcessRow).Last().MultiMap <TIn, TOut>((i, pushValue) =>
            {
                var groups = keyProcessor.GetGroups();
                foreach (var elt in groups.SelectMany(g => g.Value.Select(v => new { Row = v, g.Key })))
                {
                    pushValue(args.ResultSelector(elt.Row, elt.Key));
                }
            });

            return(CreateUnsortedStream(observableOut));
        }