Ejemplo n.º 1
0
 public Task Run(CancellationToken cancellationToken)
 {
     return(Task.Factory.StartNew(() =>
     {
         while (!cancellationToken.IsCancellationRequested)
         {
             try
             {
                 Source.Stream(cancellationToken).SelectMany((change) => ProcessChange(change));
             }
             catch (Exception e)
             {
                 Console.WriteLine("Something went wrong extracting data", e);
                 if (e is ChangeTrackingException)
                 {
                     Environment.Exit(-1);
                 }
             }
         }
     }));
 }