Table of Contents

Interface IDatasetSampler

Namespace
Azure.Iot.Operations.Connector
Assembly
Azure.Iot.Operations.Connector.dll

An object used by a connector to periodically sample a dataset on an asset.

public interface IDatasetSampler

Methods

SampleDatasetAsync(Dataset, CancellationToken)

Sample the datapoints from the asset and return the full serialized dataset.

Task<byte[]> SampleDatasetAsync(Dataset dataset, CancellationToken cancellationToken = default)

Parameters

dataset Dataset

The dataset of an asset to sample.

cancellationToken CancellationToken

Cancellation token.

Returns

Task<byte[]>

The serialized payload containing the sampled dataset.

Remarks

This method will be invoked by the PollingTelemetryConnectorWorker each time that a dataset needs to be sampled. The worker service will then forward the returned serialized payload to the MQTT broker.