Example #1
0
        public override ICacheChunk ProcessPipelineData(ICacheChunk toProcess, IDataLoadEventListener listener, GracefulCancellationToken cancellationToken)
        {
            //if(toProcess != null)
            //    throw new NotSupportedException("Expected only to be passed null chunks or never to get called, this destination is not valid for use when sources are actually sending/reading data");

            var chunk = toProcess as DoNothingCacheChunk;

            int run = 0;

            if (chunk != null)
            {
                run = chunk.RunIteration;
            }

            for (int i = 0; i < 10; i++)
            {
                File.WriteAllText(Path.Combine(CacheDirectory.FullName, "run " + run + " - loop " + i + ".txt"), DateTime.Now.ToString("O"));
                if (cancellationToken.IsCancellationRequested)
                {
                    return(null);
                }

                Thread.Sleep(60000);
            }

            return(null);
        }
Example #2
0
 public override ICacheChunk ProcessPipelineData(ICacheChunk toProcess, IDataLoadEventListener listener, GracefulCancellationToken cancellationToken)
 {
     return(ProcessPipelineData((TestDataWriterChunk)toProcess, listener, cancellationToken));
 }