Table of Contents

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

cancellationToken CancellationToken

A 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

fileBegin DateTime

The beginning of the file.

filePeriod TimeSpan

The period of the file.

samplePeriod TimeSpan

The sample period.

catalogItems CatalogItem[]

An array of catalog items to allow preparation of the file header.

cancellationToken CancellationToken

A 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

context DataWriterContext

The context.

logger ILogger

The logger.

cancellationToken CancellationToken

A 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

fileOffset TimeSpan

The offset within the current file.

requests WriteRequest[]

The array of write requests.

progress IProgress<double>

An object to report the write progress between 0.0 and 1.0.

cancellationToken CancellationToken

A token to cancel the current operation.

Returns

Task

The task.