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
readingsRegistryIReadingsRegistryThe IReadingsRegistry.
readingNamestringThe reading name.
cancellationTokenCancellationTokenA 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
readingsRegistryis null.- ArgumentNullException
readingNameis null.- KeyNotFoundException
readingNamedoes not specify a known reading.