// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information. using System.Collections.Generic; namespace System.Reactive.Joins { internal abstract class ActivePlan { Dictionary joinObservers = new Dictionary(); internal abstract void Match(); protected void AddJoinObserver(IJoinObserver joinObserver) { joinObservers.Add(joinObserver, joinObserver); } protected void Dequeue() { foreach (var joinObserver in joinObservers.Values) joinObserver.Dequeue(); } } internal class ActivePlan : ActivePlan { private readonly Action onNext; private readonly Action onCompleted; private readonly JoinObserver first; internal ActivePlan(JoinObserver first, Action onNext, Action onCompleted) { this.onNext = onNext; this.onCompleted = onCompleted; this.first = first; AddJoinObserver(first); } internal override void Match() { if (first.Queue.Count > 0) { var n1 = first.Queue.Peek(); if (n1.Kind == NotificationKind.OnCompleted) onCompleted(); else { Dequeue(); onNext(n1.Value ); } } } } internal class ActivePlan : ActivePlan { private readonly Action onNext; private readonly Action onCompleted; private readonly JoinObserver first; private readonly JoinObserver second; internal ActivePlan(JoinObserver first, JoinObserver second, Action onNext, Action onCompleted) { this.onNext = onNext; this.onCompleted = onCompleted; this.first = first; this.second = second; AddJoinObserver(first); AddJoinObserver(second); } internal override void Match() { if (first.Queue.Count > 0 && second.Queue.Count > 0) { var n1 = first.Queue.Peek(); var n2 = second.Queue.Peek(); if ( n1.Kind == NotificationKind.OnCompleted || n2.Kind == NotificationKind.OnCompleted) onCompleted(); else { Dequeue(); onNext(n1.Value, n2.Value ); } } } } internal class ActivePlan : ActivePlan { private readonly Action onNext; private readonly Action onCompleted; private readonly JoinObserver first; private readonly JoinObserver second; private readonly JoinObserver third; internal ActivePlan(JoinObserver first, JoinObserver second, JoinObserver third, Action onNext, Action onCompleted) { this.onNext = onNext; this.onCompleted = onCompleted; this.first = first; this.second = second; this.third = third; AddJoinObserver(first); AddJoinObserver(second); AddJoinObserver(third); } internal override void Match() { if (first.Queue.Count > 0 && second.Queue.Count > 0 && third.Queue.Count > 0) { var n1 = first.Queue.Peek(); var n2 = second.Queue.Peek(); var n3 = third.Queue.Peek(); if ( n1.Kind == NotificationKind.OnCompleted || n2.Kind == NotificationKind.OnCompleted || n3.Kind == NotificationKind.OnCompleted) onCompleted(); else { Dequeue(); onNext(n1.Value, n2.Value, n3.Value ); } } } } internal class ActivePlan : ActivePlan { private readonly Action onNext; private readonly Action onCompleted; private readonly JoinObserver first; private readonly JoinObserver second; private readonly JoinObserver third; private readonly JoinObserver fourth; internal ActivePlan(JoinObserver first, JoinObserver second, JoinObserver third, JoinObserver fourth, Action onNext, Action onCompleted) { this.onNext = onNext; this.onCompleted = onCompleted; this.first = first; this.second = second; this.third = third; this.fourth = fourth; AddJoinObserver(first); AddJoinObserver(second); AddJoinObserver(third); AddJoinObserver(fourth); } internal override void Match() { if (first.Queue.Count > 0 && second.Queue.Count > 0 && third.Queue.Count > 0 && fourth.Queue.Count > 0) { var n1 = first.Queue.Peek(); var n2 = second.Queue.Peek(); var n3 = third.Queue.Peek(); var n4 = fourth.Queue.Peek(); if ( n1.Kind == NotificationKind.OnCompleted || n2.Kind == NotificationKind.OnCompleted || n3.Kind == NotificationKind.OnCompleted || n4.Kind == NotificationKind.OnCompleted) onCompleted(); else { Dequeue(); onNext(n1.Value, n2.Value, n3.Value, n4.Value ); } } } } #if !NO_LARGEARITY internal class ActivePlan : ActivePlan { private readonly Action onNext; private readonly Action onCompleted; private readonly JoinObserver first; private readonly JoinObserver second; private readonly JoinObserver third; private readonly JoinObserver fourth; private readonly JoinObserver fifth; internal ActivePlan(JoinObserver first, JoinObserver second, JoinObserver third, JoinObserver fourth, JoinObserver fifth, Action onNext, Action onCompleted) { this.onNext = onNext; this.onCompleted = onCompleted; this.first = first; this.second = second; this.third = third; this.fourth = fourth; this.fifth = fifth; AddJoinObserver(first); AddJoinObserver(second); AddJoinObserver(third); AddJoinObserver(fourth); AddJoinObserver(fifth); } internal override void Match() { if (first.Queue.Count > 0 && second.Queue.Count > 0 && third.Queue.Count > 0 && fourth.Queue.Count > 0 && fifth.Queue.Count > 0) { var n1 = first.Queue.Peek(); var n2 = second.Queue.Peek(); var n3 = third.Queue.Peek(); var n4 = fourth.Queue.Peek(); var n5 = fifth.Queue.Peek(); if ( n1.Kind == NotificationKind.OnCompleted || n2.Kind == NotificationKind.OnCompleted || n3.Kind == NotificationKind.OnCompleted || n4.Kind == NotificationKind.OnCompleted || n5.Kind == NotificationKind.OnCompleted) onCompleted(); else { Dequeue(); onNext(n1.Value, n2.Value, n3.Value, n4.Value, n5.Value ); } } } } internal class ActivePlan : ActivePlan { private readonly Action onNext; private readonly Action onCompleted; private readonly JoinObserver first; private readonly JoinObserver second; private readonly JoinObserver third; private readonly JoinObserver fourth; private readonly JoinObserver fifth; private readonly JoinObserver sixth; internal ActivePlan(JoinObserver first, JoinObserver second, JoinObserver third, JoinObserver fourth, JoinObserver fifth, JoinObserver sixth, Action onNext, Action onCompleted) { this.onNext = onNext; this.onCompleted = onCompleted; this.first = first; this.second = second; this.third = third; this.fourth = fourth; this.fifth = fifth; this.sixth = sixth; AddJoinObserver(first); AddJoinObserver(second); AddJoinObserver(third); AddJoinObserver(fourth); AddJoinObserver(fifth); AddJoinObserver(sixth); } internal override void Match() { if (first.Queue.Count > 0 && second.Queue.Count > 0 && third.Queue.Count > 0 && fourth.Queue.Count > 0 && fifth.Queue.Count > 0 && sixth.Queue.Count > 0) { var n1 = first.Queue.Peek(); var n2 = second.Queue.Peek(); var n3 = third.Queue.Peek(); var n4 = fourth.Queue.Peek(); var n5 = fifth.Queue.Peek(); var n6 = sixth.Queue.Peek(); if ( n1.Kind == NotificationKind.OnCompleted || n2.Kind == NotificationKind.OnCompleted || n3.Kind == NotificationKind.OnCompleted || n4.Kind == NotificationKind.OnCompleted || n5.Kind == NotificationKind.OnCompleted || n6.Kind == NotificationKind.OnCompleted) onCompleted(); else { Dequeue(); onNext(n1.Value, n2.Value, n3.Value, n4.Value, n5.Value, n6.Value ); } } } } internal class ActivePlan : ActivePlan { private readonly Action onNext; private readonly Action onCompleted; private readonly JoinObserver first; private readonly JoinObserver second; private readonly JoinObserver third; private readonly JoinObserver fourth; private readonly JoinObserver fifth; private readonly JoinObserver sixth; private readonly JoinObserver seventh; internal ActivePlan(JoinObserver first, JoinObserver second, JoinObserver third, JoinObserver fourth, JoinObserver fifth, JoinObserver sixth, JoinObserver seventh, Action onNext, Action onCompleted) { this.onNext = onNext; this.onCompleted = onCompleted; this.first = first; this.second = second; this.third = third; this.fourth = fourth; this.fifth = fifth; this.sixth = sixth; this.seventh = seventh; AddJoinObserver(first); AddJoinObserver(second); AddJoinObserver(third); AddJoinObserver(fourth); AddJoinObserver(fifth); AddJoinObserver(sixth); AddJoinObserver(seventh); } internal override void Match() { if (first.Queue.Count > 0 && second.Queue.Count > 0 && third.Queue.Count > 0 && fourth.Queue.Count > 0 && fifth.Queue.Count > 0 && sixth.Queue.Count > 0 && seventh.Queue.Count > 0) { var n1 = first.Queue.Peek(); var n2 = second.Queue.Peek(); var n3 = third.Queue.Peek(); var n4 = fourth.Queue.Peek(); var n5 = fifth.Queue.Peek(); var n6 = sixth.Queue.Peek(); var n7 = seventh.Queue.Peek(); if ( n1.Kind == NotificationKind.OnCompleted || n2.Kind == NotificationKind.OnCompleted || n3.Kind == NotificationKind.OnCompleted || n4.Kind == NotificationKind.OnCompleted || n5.Kind == NotificationKind.OnCompleted || n6.Kind == NotificationKind.OnCompleted || n7.Kind == NotificationKind.OnCompleted) onCompleted(); else { Dequeue(); onNext(n1.Value, n2.Value, n3.Value, n4.Value, n5.Value, n6.Value, n7.Value ); } } } } internal class ActivePlan : ActivePlan { private readonly Action onNext; private readonly Action onCompleted; private readonly JoinObserver first; private readonly JoinObserver second; private readonly JoinObserver third; private readonly JoinObserver fourth; private readonly JoinObserver fifth; private readonly JoinObserver sixth; private readonly JoinObserver seventh; private readonly JoinObserver eighth; internal ActivePlan(JoinObserver first, JoinObserver second, JoinObserver third, JoinObserver fourth, JoinObserver fifth, JoinObserver sixth, JoinObserver seventh, JoinObserver eighth, Action onNext, Action onCompleted) { this.onNext = onNext; this.onCompleted = onCompleted; this.first = first; this.second = second; this.third = third; this.fourth = fourth; this.fifth = fifth; this.sixth = sixth; this.seventh = seventh; this.eighth = eighth; AddJoinObserver(first); AddJoinObserver(second); AddJoinObserver(third); AddJoinObserver(fourth); AddJoinObserver(fifth); AddJoinObserver(sixth); AddJoinObserver(seventh); AddJoinObserver(eighth); } internal override void Match() { if (first.Queue.Count > 0 && second.Queue.Count > 0 && third.Queue.Count > 0 && fourth.Queue.Count > 0 && fifth.Queue.Count > 0 && sixth.Queue.Count > 0 && seventh.Queue.Count > 0 && eighth.Queue.Count > 0) { var n1 = first.Queue.Peek(); var n2 = second.Queue.Peek(); var n3 = third.Queue.Peek(); var n4 = fourth.Queue.Peek(); var n5 = fifth.Queue.Peek(); var n6 = sixth.Queue.Peek(); var n7 = seventh.Queue.Peek(); var n8 = eighth.Queue.Peek(); if ( n1.Kind == NotificationKind.OnCompleted || n2.Kind == NotificationKind.OnCompleted || n3.Kind == NotificationKind.OnCompleted || n4.Kind == NotificationKind.OnCompleted || n5.Kind == NotificationKind.OnCompleted || n6.Kind == NotificationKind.OnCompleted || n7.Kind == NotificationKind.OnCompleted || n8.Kind == NotificationKind.OnCompleted ) onCompleted(); else { Dequeue(); onNext(n1.Value, n2.Value, n3.Value, n4.Value, n5.Value, n6.Value, n7.Value, n8.Value ); } } } } internal class ActivePlan : ActivePlan { private readonly Action onNext; private readonly Action onCompleted; private readonly JoinObserver first; private readonly JoinObserver second; private readonly JoinObserver third; private readonly JoinObserver fourth; private readonly JoinObserver fifth; private readonly JoinObserver sixth; private readonly JoinObserver seventh; private readonly JoinObserver eighth; private readonly JoinObserver ninth; internal ActivePlan(JoinObserver first, JoinObserver second, JoinObserver third, JoinObserver fourth, JoinObserver fifth, JoinObserver sixth, JoinObserver seventh, JoinObserver eighth, JoinObserver ninth, Action onNext, Action onCompleted) { this.onNext = onNext; this.onCompleted = onCompleted; this.first = first; this.second = second; this.third = third; this.fourth = fourth; this.fifth = fifth; this.sixth = sixth; this.seventh = seventh; this.eighth = eighth; this.ninth = ninth; AddJoinObserver(first); AddJoinObserver(second); AddJoinObserver(third); AddJoinObserver(fourth); AddJoinObserver(fifth); AddJoinObserver(sixth); AddJoinObserver(seventh); AddJoinObserver(eighth); AddJoinObserver(ninth); } internal override void Match() { if (first.Queue.Count > 0 && second.Queue.Count > 0 && third.Queue.Count > 0 && fourth.Queue.Count > 0 && fifth.Queue.Count > 0 && sixth.Queue.Count > 0 && seventh.Queue.Count > 0 && eighth.Queue.Count > 0 && ninth.Queue.Count > 0 ) { var n1 = first.Queue.Peek(); var n2 = second.Queue.Peek(); var n3 = third.Queue.Peek(); var n4 = fourth.Queue.Peek(); var n5 = fifth.Queue.Peek(); var n6 = sixth.Queue.Peek(); var n7 = seventh.Queue.Peek(); var n8 = eighth.Queue.Peek(); var n9 = ninth.Queue.Peek(); if ( n1.Kind == NotificationKind.OnCompleted || n2.Kind == NotificationKind.OnCompleted || n3.Kind == NotificationKind.OnCompleted || n4.Kind == NotificationKind.OnCompleted || n5.Kind == NotificationKind.OnCompleted || n6.Kind == NotificationKind.OnCompleted || n7.Kind == NotificationKind.OnCompleted || n8.Kind == NotificationKind.OnCompleted || n9.Kind == NotificationKind.OnCompleted ) onCompleted(); else { Dequeue(); onNext(n1.Value, n2.Value, n3.Value, n4.Value, n5.Value, n6.Value, n7.Value, n8.Value, n9.Value ); } } } } internal class ActivePlan : ActivePlan { private readonly Action onNext; private readonly Action onCompleted; private readonly JoinObserver first; private readonly JoinObserver second; private readonly JoinObserver third; private readonly JoinObserver fourth; private readonly JoinObserver fifth; private readonly JoinObserver sixth; private readonly JoinObserver seventh; private readonly JoinObserver eighth; private readonly JoinObserver ninth; private readonly JoinObserver tenth; internal ActivePlan(JoinObserver first, JoinObserver second, JoinObserver third, JoinObserver fourth, JoinObserver fifth, JoinObserver sixth, JoinObserver seventh, JoinObserver eighth, JoinObserver ninth, JoinObserver tenth, Action onNext, Action onCompleted) { this.onNext = onNext; this.onCompleted = onCompleted; this.first = first; this.second = second; this.third = third; this.fourth = fourth; this.fifth = fifth; this.sixth = sixth; this.seventh = seventh; this.eighth = eighth; this.ninth = ninth; this.tenth = tenth; AddJoinObserver(first); AddJoinObserver(second); AddJoinObserver(third); AddJoinObserver(fourth); AddJoinObserver(fifth); AddJoinObserver(sixth); AddJoinObserver(seventh); AddJoinObserver(eighth); AddJoinObserver(ninth); AddJoinObserver(tenth); } internal override void Match() { if (first.Queue.Count > 0 && second.Queue.Count > 0 && third.Queue.Count > 0 && fourth.Queue.Count > 0 && fifth.Queue.Count > 0 && sixth.Queue.Count > 0 && seventh.Queue.Count > 0 && eighth.Queue.Count > 0 && ninth.Queue.Count > 0 && tenth.Queue.Count > 0 ) { var n1 = first.Queue.Peek(); var n2 = second.Queue.Peek(); var n3 = third.Queue.Peek(); var n4 = fourth.Queue.Peek(); var n5 = fifth.Queue.Peek(); var n6 = sixth.Queue.Peek(); var n7 = seventh.Queue.Peek(); var n8 = eighth.Queue.Peek(); var n9 = ninth.Queue.Peek(); var n10 = tenth.Queue.Peek(); if ( n1.Kind == NotificationKind.OnCompleted || n2.Kind == NotificationKind.OnCompleted || n3.Kind == NotificationKind.OnCompleted || n4.Kind == NotificationKind.OnCompleted || n5.Kind == NotificationKind.OnCompleted || n6.Kind == NotificationKind.OnCompleted || n7.Kind == NotificationKind.OnCompleted || n8.Kind == NotificationKind.OnCompleted || n9.Kind == NotificationKind.OnCompleted || n10.Kind == NotificationKind.OnCompleted ) onCompleted(); else { Dequeue(); onNext(n1.Value, n2.Value, n3.Value, n4.Value, n5.Value, n6.Value, n7.Value, n8.Value, n9.Value, n10.Value ); } } } } internal class ActivePlan : ActivePlan { private readonly Action onNext; private readonly Action onCompleted; private readonly JoinObserver first; private readonly JoinObserver second; private readonly JoinObserver third; private readonly JoinObserver fourth; private readonly JoinObserver fifth; private readonly JoinObserver sixth; private readonly JoinObserver seventh; private readonly JoinObserver eighth; private readonly JoinObserver ninth; private readonly JoinObserver tenth; private readonly JoinObserver eleventh; internal ActivePlan(JoinObserver first, JoinObserver second, JoinObserver third, JoinObserver fourth, JoinObserver fifth, JoinObserver sixth, JoinObserver seventh, JoinObserver eighth, JoinObserver ninth, JoinObserver tenth, JoinObserver eleventh, Action onNext, Action onCompleted) { this.onNext = onNext; this.onCompleted = onCompleted; this.first = first; this.second = second; this.third = third; this.fourth = fourth; this.fifth = fifth; this.sixth = sixth; this.seventh = seventh; this.eighth = eighth; this.ninth = ninth; this.tenth = tenth; this.eleventh = eleventh; AddJoinObserver(first); AddJoinObserver(second); AddJoinObserver(third); AddJoinObserver(fourth); AddJoinObserver(fifth); AddJoinObserver(sixth); AddJoinObserver(seventh); AddJoinObserver(eighth); AddJoinObserver(ninth); AddJoinObserver(tenth); AddJoinObserver(eleventh); } internal override void Match() { if (first.Queue.Count > 0 && second.Queue.Count > 0 && third.Queue.Count > 0 && fourth.Queue.Count > 0 && fifth.Queue.Count > 0 && sixth.Queue.Count > 0 && seventh.Queue.Count > 0 && eighth.Queue.Count > 0 && ninth.Queue.Count > 0 && tenth.Queue.Count > 0 && eleventh.Queue.Count > 0 ) { var n1 = first.Queue.Peek(); var n2 = second.Queue.Peek(); var n3 = third.Queue.Peek(); var n4 = fourth.Queue.Peek(); var n5 = fifth.Queue.Peek(); var n6 = sixth.Queue.Peek(); var n7 = seventh.Queue.Peek(); var n8 = eighth.Queue.Peek(); var n9 = ninth.Queue.Peek(); var n10 = tenth.Queue.Peek(); var n11 = eleventh.Queue.Peek(); if ( n1.Kind == NotificationKind.OnCompleted || n2.Kind == NotificationKind.OnCompleted || n3.Kind == NotificationKind.OnCompleted || n4.Kind == NotificationKind.OnCompleted || n5.Kind == NotificationKind.OnCompleted || n6.Kind == NotificationKind.OnCompleted || n7.Kind == NotificationKind.OnCompleted || n8.Kind == NotificationKind.OnCompleted || n9.Kind == NotificationKind.OnCompleted || n10.Kind == NotificationKind.OnCompleted || n11.Kind == NotificationKind.OnCompleted ) onCompleted(); else { Dequeue(); onNext(n1.Value, n2.Value, n3.Value, n4.Value, n5.Value, n6.Value, n7.Value, n8.Value, n9.Value, n10.Value, n11.Value ); } } } } internal class ActivePlan : ActivePlan { private readonly Action onNext; private readonly Action onCompleted; private readonly JoinObserver first; private readonly JoinObserver second; private readonly JoinObserver third; private readonly JoinObserver fourth; private readonly JoinObserver fifth; private readonly JoinObserver sixth; private readonly JoinObserver seventh; private readonly JoinObserver eighth; private readonly JoinObserver ninth; private readonly JoinObserver tenth; private readonly JoinObserver eleventh; private readonly JoinObserver twelfth; internal ActivePlan(JoinObserver first, JoinObserver second, JoinObserver third, JoinObserver fourth, JoinObserver fifth, JoinObserver sixth, JoinObserver seventh, JoinObserver eighth, JoinObserver ninth, JoinObserver tenth, JoinObserver eleventh, JoinObserver twelfth, Action onNext, Action onCompleted) { this.onNext = onNext; this.onCompleted = onCompleted; this.first = first; this.second = second; this.third = third; this.fourth = fourth; this.fifth = fifth; this.sixth = sixth; this.seventh = seventh; this.eighth = eighth; this.ninth = ninth; this.tenth = tenth; this.eleventh = eleventh; this.twelfth = twelfth; AddJoinObserver(first); AddJoinObserver(second); AddJoinObserver(third); AddJoinObserver(fourth); AddJoinObserver(fifth); AddJoinObserver(sixth); AddJoinObserver(seventh); AddJoinObserver(eighth); AddJoinObserver(ninth); AddJoinObserver(tenth); AddJoinObserver(eleventh); AddJoinObserver(twelfth); } internal override void Match() { if (first.Queue.Count > 0 && second.Queue.Count > 0 && third.Queue.Count > 0 && fourth.Queue.Count > 0 && fifth.Queue.Count > 0 && sixth.Queue.Count > 0 && seventh.Queue.Count > 0 && eighth.Queue.Count > 0 && ninth.Queue.Count > 0 && tenth.Queue.Count > 0 && eleventh.Queue.Count > 0 && twelfth.Queue.Count > 0 ) { var n1 = first.Queue.Peek(); var n2 = second.Queue.Peek(); var n3 = third.Queue.Peek(); var n4 = fourth.Queue.Peek(); var n5 = fifth.Queue.Peek(); var n6 = sixth.Queue.Peek(); var n7 = seventh.Queue.Peek(); var n8 = eighth.Queue.Peek(); var n9 = ninth.Queue.Peek(); var n10 = tenth.Queue.Peek(); var n11 = eleventh.Queue.Peek(); var n12 = twelfth.Queue.Peek(); if ( n1.Kind == NotificationKind.OnCompleted || n2.Kind == NotificationKind.OnCompleted || n3.Kind == NotificationKind.OnCompleted || n4.Kind == NotificationKind.OnCompleted || n5.Kind == NotificationKind.OnCompleted || n6.Kind == NotificationKind.OnCompleted || n7.Kind == NotificationKind.OnCompleted || n8.Kind == NotificationKind.OnCompleted || n9.Kind == NotificationKind.OnCompleted || n10.Kind == NotificationKind.OnCompleted || n11.Kind == NotificationKind.OnCompleted || n12.Kind == NotificationKind.OnCompleted ) onCompleted(); else { Dequeue(); onNext(n1.Value, n2.Value, n3.Value, n4.Value, n5.Value, n6.Value, n7.Value, n8.Value, n9.Value, n10.Value, n11.Value, n12.Value ); } } } } internal class ActivePlan : ActivePlan { private readonly Action onNext; private readonly Action onCompleted; private readonly JoinObserver first; private readonly JoinObserver second; private readonly JoinObserver third; private readonly JoinObserver fourth; private readonly JoinObserver fifth; private readonly JoinObserver sixth; private readonly JoinObserver seventh; private readonly JoinObserver eighth; private readonly JoinObserver ninth; private readonly JoinObserver tenth; private readonly JoinObserver eleventh; private readonly JoinObserver twelfth; private readonly JoinObserver thirteenth; internal ActivePlan(JoinObserver first, JoinObserver second, JoinObserver third, JoinObserver fourth, JoinObserver fifth, JoinObserver sixth, JoinObserver seventh, JoinObserver eighth, JoinObserver ninth, JoinObserver tenth, JoinObserver eleventh, JoinObserver twelfth, JoinObserver thirteenth, Action onNext, Action onCompleted) { this.onNext = onNext; this.onCompleted = onCompleted; this.first = first; this.second = second; this.third = third; this.fourth = fourth; this.fifth = fifth; this.sixth = sixth; this.seventh = seventh; this.eighth = eighth; this.ninth = ninth; this.tenth = tenth; this.eleventh = eleventh; this.twelfth = twelfth; this.thirteenth = thirteenth; AddJoinObserver(first); AddJoinObserver(second); AddJoinObserver(third); AddJoinObserver(fourth); AddJoinObserver(fifth); AddJoinObserver(sixth); AddJoinObserver(seventh); AddJoinObserver(eighth); AddJoinObserver(ninth); AddJoinObserver(tenth); AddJoinObserver(eleventh); AddJoinObserver(twelfth); AddJoinObserver(thirteenth); } internal override void Match() { if (first.Queue.Count > 0 && second.Queue.Count > 0 && third.Queue.Count > 0 && fourth.Queue.Count > 0 && fifth.Queue.Count > 0 && sixth.Queue.Count > 0 && seventh.Queue.Count > 0 && eighth.Queue.Count > 0 && ninth.Queue.Count > 0 && tenth.Queue.Count > 0 && eleventh.Queue.Count > 0 && twelfth.Queue.Count > 0 && thirteenth.Queue.Count > 0 ) { var n1 = first.Queue.Peek(); var n2 = second.Queue.Peek(); var n3 = third.Queue.Peek(); var n4 = fourth.Queue.Peek(); var n5 = fifth.Queue.Peek(); var n6 = sixth.Queue.Peek(); var n7 = seventh.Queue.Peek(); var n8 = eighth.Queue.Peek(); var n9 = ninth.Queue.Peek(); var n10 = tenth.Queue.Peek(); var n11 = eleventh.Queue.Peek(); var n12 = twelfth.Queue.Peek(); var n13 = thirteenth.Queue.Peek(); if ( n1.Kind == NotificationKind.OnCompleted || n2.Kind == NotificationKind.OnCompleted || n3.Kind == NotificationKind.OnCompleted || n4.Kind == NotificationKind.OnCompleted || n5.Kind == NotificationKind.OnCompleted || n6.Kind == NotificationKind.OnCompleted || n7.Kind == NotificationKind.OnCompleted || n8.Kind == NotificationKind.OnCompleted || n9.Kind == NotificationKind.OnCompleted || n10.Kind == NotificationKind.OnCompleted || n11.Kind == NotificationKind.OnCompleted || n12.Kind == NotificationKind.OnCompleted || n13.Kind == NotificationKind.OnCompleted ) onCompleted(); else { Dequeue(); onNext(n1.Value, n2.Value, n3.Value, n4.Value, n5.Value, n6.Value, n7.Value, n8.Value, n9.Value, n10.Value, n11.Value, n12.Value, n13.Value ); } } } } internal class ActivePlan : ActivePlan { private readonly Action onNext; private readonly Action onCompleted; private readonly JoinObserver first; private readonly JoinObserver second; private readonly JoinObserver third; private readonly JoinObserver fourth; private readonly JoinObserver fifth; private readonly JoinObserver sixth; private readonly JoinObserver seventh; private readonly JoinObserver eighth; private readonly JoinObserver ninth; private readonly JoinObserver tenth; private readonly JoinObserver eleventh; private readonly JoinObserver twelfth; private readonly JoinObserver thirteenth; private readonly JoinObserver fourteenth; internal ActivePlan(JoinObserver first, JoinObserver second, JoinObserver third, JoinObserver fourth, JoinObserver fifth, JoinObserver sixth, JoinObserver seventh, JoinObserver eighth, JoinObserver ninth, JoinObserver tenth, JoinObserver eleventh, JoinObserver twelfth, JoinObserver thirteenth, JoinObserver fourteenth, Action onNext, Action onCompleted) { this.onNext = onNext; this.onCompleted = onCompleted; this.first = first; this.second = second; this.third = third; this.fourth = fourth; this.fifth = fifth; this.sixth = sixth; this.seventh = seventh; this.eighth = eighth; this.ninth = ninth; this.tenth = tenth; this.eleventh = eleventh; this.twelfth = twelfth; this.thirteenth = thirteenth; this.fourteenth = fourteenth; AddJoinObserver(first); AddJoinObserver(second); AddJoinObserver(third); AddJoinObserver(fourth); AddJoinObserver(fifth); AddJoinObserver(sixth); AddJoinObserver(seventh); AddJoinObserver(eighth); AddJoinObserver(ninth); AddJoinObserver(tenth); AddJoinObserver(eleventh); AddJoinObserver(twelfth); AddJoinObserver(thirteenth); AddJoinObserver(fourteenth); } internal override void Match() { if (first.Queue.Count > 0 && second.Queue.Count > 0 && third.Queue.Count > 0 && fourth.Queue.Count > 0 && fifth.Queue.Count > 0 && sixth.Queue.Count > 0 && seventh.Queue.Count > 0 && eighth.Queue.Count > 0 && ninth.Queue.Count > 0 && tenth.Queue.Count > 0 && eleventh.Queue.Count > 0 && twelfth.Queue.Count > 0 && thirteenth.Queue.Count > 0 && fourteenth.Queue.Count > 0 ) { var n1 = first.Queue.Peek(); var n2 = second.Queue.Peek(); var n3 = third.Queue.Peek(); var n4 = fourth.Queue.Peek(); var n5 = fifth.Queue.Peek(); var n6 = sixth.Queue.Peek(); var n7 = seventh.Queue.Peek(); var n8 = eighth.Queue.Peek(); var n9 = ninth.Queue.Peek(); var n10 = tenth.Queue.Peek(); var n11 = eleventh.Queue.Peek(); var n12 = twelfth.Queue.Peek(); var n13 = thirteenth.Queue.Peek(); var n14 = fourteenth.Queue.Peek(); if ( n1.Kind == NotificationKind.OnCompleted || n2.Kind == NotificationKind.OnCompleted || n3.Kind == NotificationKind.OnCompleted || n4.Kind == NotificationKind.OnCompleted || n5.Kind == NotificationKind.OnCompleted || n6.Kind == NotificationKind.OnCompleted || n7.Kind == NotificationKind.OnCompleted || n8.Kind == NotificationKind.OnCompleted || n9.Kind == NotificationKind.OnCompleted || n10.Kind == NotificationKind.OnCompleted || n11.Kind == NotificationKind.OnCompleted || n12.Kind == NotificationKind.OnCompleted || n13.Kind == NotificationKind.OnCompleted || n14.Kind == NotificationKind.OnCompleted ) onCompleted(); else { Dequeue(); onNext(n1.Value, n2.Value, n3.Value, n4.Value, n5.Value, n6.Value, n7.Value, n8.Value, n9.Value, n10.Value, n11.Value, n12.Value, n13.Value, n14.Value ); } } } } internal class ActivePlan : ActivePlan { private readonly Action onNext; private readonly Action onCompleted; private readonly JoinObserver first; private readonly JoinObserver second; private readonly JoinObserver third; private readonly JoinObserver fourth; private readonly JoinObserver fifth; private readonly JoinObserver sixth; private readonly JoinObserver seventh; private readonly JoinObserver eighth; private readonly JoinObserver ninth; private readonly JoinObserver tenth; private readonly JoinObserver eleventh; private readonly JoinObserver twelfth; private readonly JoinObserver thirteenth; private readonly JoinObserver fourteenth; private readonly JoinObserver fifteenth; internal ActivePlan(JoinObserver first, JoinObserver second, JoinObserver third, JoinObserver fourth, JoinObserver fifth, JoinObserver sixth, JoinObserver seventh, JoinObserver eighth, JoinObserver ninth, JoinObserver tenth, JoinObserver eleventh, JoinObserver twelfth, JoinObserver thirteenth, JoinObserver fourteenth, JoinObserver fifteenth, Action onNext, Action onCompleted) { this.onNext = onNext; this.onCompleted = onCompleted; this.first = first; this.second = second; this.third = third; this.fourth = fourth; this.fifth = fifth; this.sixth = sixth; this.seventh = seventh; this.eighth = eighth; this.ninth = ninth; this.tenth = tenth; this.eleventh = eleventh; this.twelfth = twelfth; this.thirteenth = thirteenth; this.fourteenth = fourteenth; this.fifteenth = fifteenth; AddJoinObserver(first); AddJoinObserver(second); AddJoinObserver(third); AddJoinObserver(fourth); AddJoinObserver(fifth); AddJoinObserver(sixth); AddJoinObserver(seventh); AddJoinObserver(eighth); AddJoinObserver(ninth); AddJoinObserver(tenth); AddJoinObserver(eleventh); AddJoinObserver(twelfth); AddJoinObserver(thirteenth); AddJoinObserver(fourteenth); AddJoinObserver(fifteenth); } internal override void Match() { if (first.Queue.Count > 0 && second.Queue.Count > 0 && third.Queue.Count > 0 && fourth.Queue.Count > 0 && fifth.Queue.Count > 0 && sixth.Queue.Count > 0 && seventh.Queue.Count > 0 && eighth.Queue.Count > 0 && ninth.Queue.Count > 0 && tenth.Queue.Count > 0 && eleventh.Queue.Count > 0 && twelfth.Queue.Count > 0 && thirteenth.Queue.Count > 0 && fourteenth.Queue.Count > 0 && fifteenth.Queue.Count > 0 ) { var n1 = first.Queue.Peek(); var n2 = second.Queue.Peek(); var n3 = third.Queue.Peek(); var n4 = fourth.Queue.Peek(); var n5 = fifth.Queue.Peek(); var n6 = sixth.Queue.Peek(); var n7 = seventh.Queue.Peek(); var n8 = eighth.Queue.Peek(); var n9 = ninth.Queue.Peek(); var n10 = tenth.Queue.Peek(); var n11 = eleventh.Queue.Peek(); var n12 = twelfth.Queue.Peek(); var n13 = thirteenth.Queue.Peek(); var n14 = fourteenth.Queue.Peek(); var n15 = fifteenth.Queue.Peek(); if ( n1.Kind == NotificationKind.OnCompleted || n2.Kind == NotificationKind.OnCompleted || n3.Kind == NotificationKind.OnCompleted || n4.Kind == NotificationKind.OnCompleted || n5.Kind == NotificationKind.OnCompleted || n6.Kind == NotificationKind.OnCompleted || n7.Kind == NotificationKind.OnCompleted || n8.Kind == NotificationKind.OnCompleted || n9.Kind == NotificationKind.OnCompleted || n10.Kind == NotificationKind.OnCompleted || n11.Kind == NotificationKind.OnCompleted || n12.Kind == NotificationKind.OnCompleted || n13.Kind == NotificationKind.OnCompleted || n14.Kind == NotificationKind.OnCompleted || n15.Kind == NotificationKind.OnCompleted ) onCompleted(); else { Dequeue(); onNext(n1.Value, n2.Value, n3.Value, n4.Value, n5.Value, n6.Value, n7.Value, n8.Value, n9.Value, n10.Value, n11.Value, n12.Value, n13.Value, n14.Value, n15.Value ); } } } } internal class ActivePlan : ActivePlan { private readonly Action onNext; private readonly Action onCompleted; private readonly JoinObserver first; private readonly JoinObserver second; private readonly JoinObserver third; private readonly JoinObserver fourth; private readonly JoinObserver fifth; private readonly JoinObserver sixth; private readonly JoinObserver seventh; private readonly JoinObserver eighth; private readonly JoinObserver ninth; private readonly JoinObserver tenth; private readonly JoinObserver eleventh; private readonly JoinObserver twelfth; private readonly JoinObserver thirteenth; private readonly JoinObserver fourteenth; private readonly JoinObserver fifteenth; private readonly JoinObserver sixteenth; internal ActivePlan(JoinObserver first, JoinObserver second, JoinObserver third, JoinObserver fourth, JoinObserver fifth, JoinObserver sixth, JoinObserver seventh, JoinObserver eighth, JoinObserver ninth, JoinObserver tenth, JoinObserver eleventh, JoinObserver twelfth, JoinObserver thirteenth, JoinObserver fourteenth, JoinObserver fifteenth, JoinObserver sixteenth, Action onNext, Action onCompleted) { this.onNext = onNext; this.onCompleted = onCompleted; this.first = first; this.second = second; this.third = third; this.fourth = fourth; this.fifth = fifth; this.sixth = sixth; this.seventh = seventh; this.eighth = eighth; this.ninth = ninth; this.tenth = tenth; this.eleventh = eleventh; this.twelfth = twelfth; this.thirteenth = thirteenth; this.fourteenth = fourteenth; this.fifteenth = fifteenth; this.sixteenth = sixteenth; AddJoinObserver(first); AddJoinObserver(second); AddJoinObserver(third); AddJoinObserver(fourth); AddJoinObserver(fifth); AddJoinObserver(sixth); AddJoinObserver(seventh); AddJoinObserver(eighth); AddJoinObserver(ninth); AddJoinObserver(tenth); AddJoinObserver(eleventh); AddJoinObserver(twelfth); AddJoinObserver(thirteenth); AddJoinObserver(fourteenth); AddJoinObserver(fifteenth); AddJoinObserver(sixteenth); } internal override void Match() { if (first.Queue.Count > 0 && second.Queue.Count > 0 && third.Queue.Count > 0 && fourth.Queue.Count > 0 && fifth.Queue.Count > 0 && sixth.Queue.Count > 0 && seventh.Queue.Count > 0 && eighth.Queue.Count > 0 && ninth.Queue.Count > 0 && tenth.Queue.Count > 0 && eleventh.Queue.Count > 0 && twelfth.Queue.Count > 0 && thirteenth.Queue.Count > 0 && fourteenth.Queue.Count > 0 && fifteenth.Queue.Count > 0 && sixteenth.Queue.Count > 0 ) { var n1 = first.Queue.Peek(); var n2 = second.Queue.Peek(); var n3 = third.Queue.Peek(); var n4 = fourth.Queue.Peek(); var n5 = fifth.Queue.Peek(); var n6 = sixth.Queue.Peek(); var n7 = seventh.Queue.Peek(); var n8 = eighth.Queue.Peek(); var n9 = ninth.Queue.Peek(); var n10 = tenth.Queue.Peek(); var n11 = eleventh.Queue.Peek(); var n12 = twelfth.Queue.Peek(); var n13 = thirteenth.Queue.Peek(); var n14 = fourteenth.Queue.Peek(); var n15 = fifteenth.Queue.Peek(); var n16 = sixteenth.Queue.Peek(); if ( n1.Kind == NotificationKind.OnCompleted || n2.Kind == NotificationKind.OnCompleted || n3.Kind == NotificationKind.OnCompleted || n4.Kind == NotificationKind.OnCompleted || n5.Kind == NotificationKind.OnCompleted || n6.Kind == NotificationKind.OnCompleted || n7.Kind == NotificationKind.OnCompleted || n8.Kind == NotificationKind.OnCompleted || n9.Kind == NotificationKind.OnCompleted || n10.Kind == NotificationKind.OnCompleted || n11.Kind == NotificationKind.OnCompleted || n12.Kind == NotificationKind.OnCompleted || n13.Kind == NotificationKind.OnCompleted || n14.Kind == NotificationKind.OnCompleted || n15.Kind == NotificationKind.OnCompleted || n16.Kind == NotificationKind.OnCompleted ) onCompleted(); else { Dequeue(); onNext(n1.Value, n2.Value, n3.Value, n4.Value, n5.Value, n6.Value, n7.Value, n8.Value, n9.Value, n10.Value, n11.Value, n12.Value, n13.Value, n14.Value, n15.Value, n16.Value ); } } } } #endif }