Class ReadingsRegistryExtensions
Extension methods for IReadingsRegistry.
public static class ReadingsRegistryExtensions
- Inheritance
-
ReadingsRegistryExtensions
- Inherited Members
Methods
GetLatestReadingValueAsync(IReadingsRegistry, string, CancellationToken)
Gets the latest value from a reading data source.
public static Task<TimestampedReadingValue> GetLatestReadingValueAsync(this IReadingsRegistry readingsRegistry, string readingName, CancellationToken cancellationToken = default)
Parameters
readingsRegistry
IReadingsRegistryThe IReadingsRegistry.
readingName
stringThe reading name.
cancellationToken
CancellationTokenA token that can request canceling waiting on the reading value.
Returns
- Task<TimestampedReadingValue>
A task that represents the asynchronous operation. The value of its Result property contains the reading value.
Exceptions
- ArgumentNullException
readingsRegistry
is null.- ArgumentNullException
readingName
is null.- KeyNotFoundException
readingName
does not specify a known reading.