public void ApplyReader(IReaderAction <TData> readerAction) { var reader = new Reader <TData>(_channel.Reader, readerAction); var awaiter = reader.BeginConsume(_source.Token).GetAwaiter(); if (awaiter.IsCompleted) { throw new OperationCanceledException($"Name: {reader.Identification.Name}>{readerAction.Identification.Id}"); } }
public Reader(ChannelReader <TData> channel, IReaderAction <TData> readerAction) { if (readerAction.Identification is null) { throw new ArgumentNullException(nameof(readerAction.Identification)); } _channel = channel; _readerAction = readerAction; }