public Block?Take() { _semaphore.Wait(); try { return(_core.Take()); } finally { _semaphore.Release(); } }
public IterationResult Iterate() { var block = _source.Take(); if (block == null) { return(IterationResult.Break); } var processedBlock = _processor.Process(block); _sink.Put(processedBlock); return(IterationResult.Continue); }
public static IEnumerable <Block> TakeAll(this IBlockSource Reader) { while (true) { var block = Reader.Take(); if (block != null) { yield return(block); } else { yield break; } } }