OpenRoadCode
Public API reference for OpenRoadCode
Loading...
Searching...
No Matches
weather.weather_snapshot_cache.WeatherSnapshotCache Class Reference

Persist and validate the latest typed weather snapshot. More...

Public Member Functions

WeatherSnapshot|None load (self)
 Load the latest snapshot, ignoring absent or invalid data.
 
None store (self, WeatherSnapshot snapshot)
 Serialize and atomically persist a weather snapshot.
 

Detailed Description

Persist and validate the latest typed weather snapshot.

Member Function Documentation

◆ load()

WeatherSnapshot | None weather.weather_snapshot_cache.WeatherSnapshotCache.load (   self)

Load the latest snapshot, ignoring absent or invalid data.

Returns
Valid cached snapshot or None.

◆ store()

None weather.weather_snapshot_cache.WeatherSnapshotCache.store (   self,
WeatherSnapshot  snapshot 
)

Serialize and atomically persist a weather snapshot.

Parameters
snapshotValid weather data to store.

The documentation for this class was generated from the following file: