protected override TStream CreateOutputStream(SubstractUnsortedArgs <TStream, TInLeft, TInRight, TKey> args) { var keyToExcludeHashObservable = args.RightInputStream.Observable.ToList().Map(i => new HashSet <TKey>(i.Select(j => args.GetRightKey(j)).Distinct())); var outObservable = args.LeftInputStream.Observable .CombineWithLatest( keyToExcludeHashObservable, (l, r) => new { Value = l, MustExclude = r.Contains(args.GetLeftKey(l)) }) .Filter(i => !i.MustExclude) .Map(i => i.Value); return(base.CreateMatchingStream(outObservable, args.LeftInputStream)); }
public SubstractUnsortedStreamNode(string name, SubstractUnsortedArgs <TStream, TInLeft, TInRight, TKey> args) : base(name, args) { }