Parse() публичный Метод

Parses the feed.
public Parse ( ) : bool
Результат bool
Пример #1
0
        static void ThreadPoolTask(object data)
        {
            var f = new FeedParser(((ThreadPoolDataWrapper) data).FeedSource);
            f.Parse();
            var threadPoolDataWrapper = data as ThreadPoolDataWrapper;

            if (threadPoolDataWrapper != null) 
                threadPoolDataWrapper.ResetEvent.Set();
        }
Пример #2
0
        private static TimeSpan MeasureParallelForeach(IEnumerable<string> feedSources)
        {
            var stopwatch = new Stopwatch();
            stopwatch.Start();

            Parallel.ForEach(feedSources, feedSource =>
                {
                    var f = new FeedParser(feedSource);
                    f.Parse();
                }
            );

            stopwatch.Stop();
            return stopwatch.Elapsed;
        }
Пример #3
0
 private static void TPLFeedParserTask(string feedSource)
 {
     var f = new FeedParser(feedSource);
     f.Parse();
 }
Пример #4
0
        /// <summary>
        /// Measures threaded version.
        /// </summary>
        /// <param name="feedSources"></param>
        /// <returns></returns>
		private static TimeSpan MeasureThreads(IList<string> feedSources)
		{
            var stopwatch = new Stopwatch();
            stopwatch.Start();

			var threads = new Thread[feedSources.Count];

			for (var i = 0; i < feedSources.Count; i++)
			{
                var source = feedSources[i]; /* work-around modified closures */
				var feedParser = new FeedParser(source);
				threads[i] = new Thread(() => feedParser.Parse());
				threads[i].Start();
			}

			foreach (var thread in threads)
			{
				thread.Join();
			}

            stopwatch.Stop();
            return stopwatch.Elapsed;            
		}