Interface IDataWriter
- Namespace
- Nexus.Extensibility
- Assembly
- Nexus.Extensibility.dll
A data writer.
public interface IDataWriter
Methods
CloseAsync(CancellationToken)
Closes the current and flushes the data to disk.
Task CloseAsync(CancellationToken cancellationToken)
Parameters
cancellationTokenCancellationTokenA token to cancel the current operation.
Returns
- Task
The task.
OpenAsync(DateTime, TimeSpan, TimeSpan, CatalogItem[], CancellationToken)
Opens or creates a file for the specified parameters.
Task OpenAsync(DateTime fileBegin, TimeSpan filePeriod, TimeSpan samplePeriod, CatalogItem[] catalogItems, CancellationToken cancellationToken)
Parameters
fileBeginDateTimeThe beginning of the file.
filePeriodTimeSpanThe period of the file.
samplePeriodTimeSpanThe sample period.
catalogItemsCatalogItem[]An array of catalog items to allow preparation of the file header.
cancellationTokenCancellationTokenA token to cancel the current operation.
Returns
- Task
The task.
SetContextAsync(DataWriterContext, ILogger, CancellationToken)
Invoked by Nexus right after construction to provide the context.
Task SetContextAsync(DataWriterContext context, ILogger logger, CancellationToken cancellationToken)
Parameters
contextDataWriterContextThe
context.loggerILoggerThe logger.
cancellationTokenCancellationTokenA token to cancel the current operation.
Returns
- Task
The task.
WriteAsync(TimeSpan, WriteRequest[], IProgress<double>, CancellationToken)
Performs a number of write requests.
Task WriteAsync(TimeSpan fileOffset, WriteRequest[] requests, IProgress<double> progress, CancellationToken cancellationToken)
Parameters
fileOffsetTimeSpanThe offset within the current file.
requestsWriteRequest[]The array of write requests.
progressIProgress<double>An object to report the write progress between 0.0 and 1.0.
cancellationTokenCancellationTokenA token to cancel the current operation.
Returns
- Task
The task.