Пример #1
0
        public void Subscribe(IMaybeObserver <R> observer)
        {
            var n    = 0;
            var srcs = sources;

            var a = new IMaybeSource <T> [8];

            try
            {
                foreach (var m in srcs)
                {
                    if (n == a.Length)
                    {
                        var b = new IMaybeSource <T> [n + (n >> 2)];
                        Array.Copy(a, 0, b, 0, n);
                        a = b;
                    }
                    a[n++] = m;
                }
            }
            catch (Exception ex)
            {
                DisposableHelper.Error(observer, ex);
                return;
            }

            MaybeZipCoordinator <T, R> .Run(a, n, observer, mapper, delayErrors);
        }
Пример #2
0
        public void Subscribe(IMaybeObserver <R> observer)
        {
            var srcs = sources;
            var n    = srcs.Length;

            MaybeZipCoordinator <T, R> .Run(srcs, n, observer, mapper, delayErrors);
        }