public override void Subscribe(IFlowableSubscriber <T> subscriber)
        {
            var s      = sources;
            var parent = new AmbSubscription(subscriber, s.Length);

            subscriber.OnSubscribe(parent);
            parent.Subscribe(s);
        }
        public void Subscribe(ISubscriber <T> s)
        {
            int n;

            IPublisher <T>[] a;

            if (!MultiSourceHelper.ToArray(sources, sourcesEnumerable, s, out n, out a))
            {
                return;
            }

            if (n == 0)
            {
                EmptySubscription <T> .Complete(s);

                return;
            }
            else
            if (n == 1)
            {
                a[0].Subscribe(s);
                return;
            }

            if (s is IConditionalSubscriber <T> )
            {
                AmbConditionalSubscription parent = new AmbConditionalSubscription((IConditionalSubscriber <T>)s, n);

                s.OnSubscribe(parent);

                parent.Subscribe(a, n);
            }
            else
            {
                AmbSubscription parent = new AmbSubscription(s, n);

                s.OnSubscribe(parent);

                parent.Subscribe(a, n);
            }
        }
 internal AmbInnerSubscriber(AmbSubscription parent, ISubscriber <T> actual, int index)
 {
     this.parent = parent;
     this.actual = actual;
     this.index  = index;
 }
 internal AmbSubscriber(AmbSubscription parent, int index)
 {
     this.parent = parent;
     this.actual = parent.actual;
     this.index  = index;
 }