Welcome to mirror list, hosted at ThFree Co, Russian Federation.

ConcatSink.cs « Internal « Reactive « System.Reactive.Linq « Rx.NET - github.com/mono/rx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 5f4a12f6e574a3662774e6324ad532f7e9943dd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
// Copyright (c) Microsoft Open Technologies, Inc. All rights reserved. See License.txt in the project root for license information.

using System;
using System.Collections.Generic;

namespace System.Reactive
{
    abstract class ConcatSink<TSource> : TailRecursiveSink<TSource>
    {
        public ConcatSink(IObserver<TSource> observer, IDisposable cancel)
                : base(observer, cancel)
        {
        }

        protected override IEnumerable<IObservable<TSource>> Extract(IObservable<TSource> source)
        {
            var concat = source as IConcatenatable<TSource>;
            if (concat != null)
                return concat.GetSources();

            return null;
        }

        public override void OnCompleted()
        {
            _recurse();
        }
    }
}