Expand description
REST-based asset information providers and polling mechanisms.
This module provides functionality for polling asset information from REST APIs. It defines a trait for asset information providers and a function for starting a polling loop that periodically fetches and stores asset information.
The module provides:
- The
AssetInfoProvidertrait which defines the interface for REST-based asset info providers - The
start_pollingfunction which implements the polling loop mechanism
§Polling Strategy
The polling strategy follows these principles:
- Regular Intervals: Asset information is polled at regular intervals
- Timeout Protection: Requests that take too long are cancelled to prevent blocking
- Error Handling: Errors during polling are logged but don’t stop the polling process
- Graceful Cancellation: Polling can be gracefully stopped using a cancellation token
When implementing new REST-based asset providers, implement the AssetInfoProvider trait
and use the start_polling function to handle the polling lifecycle.
Traits§
- Asset
Info Provider - Trait for providers that can fetch asset information from REST APIs.
Functions§
- start_
polling - Starts polling asset information from a provider at the specified update interval.