Class CsvAsyncInputBase
Models a CSV source data stream that can be processed asynchronously.
Inherited Members
Namespace: Cursively.Inputs
Assembly: Cursively.dll
Syntax
public abstract class CsvAsyncInputBase
Methods
| Improve this Doc View SourceProcessAsync(CsvReaderVisitorBase, IProgress<Int32>, CancellationToken)
Describes the contents of this CSV data stream to a CsvReaderVisitorBase.
Declaration
public ValueTask ProcessAsync(CsvReaderVisitorBase visitor, IProgress<int> progress = null, CancellationToken cancellationToken = default(CancellationToken))
Parameters
Type | Name | Description |
---|---|---|
CsvReaderVisitorBase | visitor | The CsvReaderVisitorBase to describe this CSV data stream to. |
IProgress<Int32> | progress | An optional IProgress<T> instance that will receive a report of the size of each chunk (in bytes) as processing finishes, followed by one more report with a zero when the last chunk in the stream has been processed. |
CancellationToken | cancellationToken | An optional CancellationToken that may be used to signal cancellation. |
Returns
Type | Description |
---|---|
ValueTask | A ValueTask encapsulating the operation. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when this stream has already been processed. |
OperationCanceledException | Thrown to acknowledge a canceled |
ProcessAsyncCore(CsvReaderVisitorBase, IProgress<Int32>, CancellationToken)
Implements the inner logic for ProcessAsync(CsvReaderVisitorBase, IProgress<Int32>, CancellationToken).
Declaration
protected abstract ValueTask ProcessAsyncCore(CsvReaderVisitorBase visitor, IProgress<int> progress, CancellationToken cancellationToken)
Parameters
Type | Name | Description |
---|---|---|
CsvReaderVisitorBase | visitor | The CsvReaderVisitorBase to describe this CSV data stream to. |
IProgress<Int32> | progress | An optional IProgress<T> instance that will receive a report of the size of each chunk (in bytes) as processing finishes, followed by one more report with a zero when the last chunk in the stream has been processed. |
CancellationToken | cancellationToken | An optional CancellationToken that may be used to signal cancellation. |
Returns
Type | Description |
---|---|
ValueTask | A ValueTask encapsulating the operation. |
Exceptions
Type | Condition |
---|---|
InvalidOperationException | Thrown when this stream has already been processed. |
OperationCanceledException | Thrown to acknowledge a canceled |
ThrowIfProcessingHasAlreadyStarted()
Throws if ProcessAsync(CsvReaderVisitorBase, IProgress<Int32>, CancellationToken) has already been called for this instance.
Declaration
protected void ThrowIfProcessingHasAlreadyStarted()