Exemplo n.º 1
0
        public static void WithGroups()
        {
            IObservable <long> ticks           = Observable.Interval(TimeSpan.FromSeconds(6));
            IObservable <int>  wordGroupCounts = from tick in ticks
                                                 join word in words
                                                 on ticks equals words into wordsInTick
                                                 from count in wordsInTick.Count()
                                                 select count * 10;

            wordGroupCounts.Subscribe(c => Console.WriteLine($"Words per minute: {c}"));

            keySource.Run();
        }