public static Action<ProcessSample> FromSource(ISourceReader shortSourceReader, Func<bool> isAborted) { return next => { foreach (var s in shortSourceReader.Samples()) if (isAborted()) break; else next(s); }; }