书上例子。
using System;
using System.Collections.Concurrent;
using System.IO;
using System.Linq;
using System.Threading.Tasks;
namespace Wrox.ProCSharp.Collections
{
public class MainEntryPont
{
static int Main(string[] args)
{
StartPipeline();
Console.ReadKey();
return 0;
}
private static async void StartPipeline()
{
var filenames = new BlockingCollection<string>();
var lines = new BlockingCollection<string>();
var words = new ConcurrentDictionary<string, int>();
var items = new BlockingCollection<Info>();
var coloredItems = new BlockingCollection<Info>();
Task t1 = PipelineStages.ReadFilenamesAsync(@"E:\netstudy\test",filenames);
ConsoleHelper.WriteLine("started stage 1");
Task t2 = PipelineStages.LoadContentAsync(filenames, lines);
ConsoleHelper.WriteLine("started stage 2");
Task t3 = PipelineSta