public static IEnumerable StreamStatuses()

in DataGenerators/TwitterClientCore/TwitterStream.cs [26:57]


        public static IEnumerable<string> StreamStatuses(TwitterConfig config)
        {
            TextReader streamReader = ReadTweets(config);
            if(streamReader == StreamReader.Null)
            {
                throw new Exception("Could not connect to twitter with credentials provided");
            }

            while (true)
            {
                string line = null;
                try 
                { 
                    line = streamReader.ReadLine(); 
                }
                catch (Exception e) 
                { 
                    Console.WriteLine($"Ignoring :{e}");
                }

                if (!string.IsNullOrWhiteSpace(line))
                {
                    yield return line;
                }

                // Reconnect to the twitter feed.
                if (line == null)
                {
                    streamReader = ReadTweets(config);
                }
            }
        }