caproto.server.autosave.AutosaveHelper¶

- class caproto.server.autosave.AutosaveHelper(*args, file_manager: RotatingFileManager | None = None, **kwargs)[source]¶
AutosaveHelper pvproperties¶ Attribute
Suffix
Docs
Type
Notes
Alarm Group
autosave_hook
:__autosave_hook__Internal hook which handles autosave functionality
int
Read-only Startup
Methods
find_autosave_properties()Yield (pvprop, channeldata) for all tagged with autosaved.
group_read(instance)Generic read called for channels without get defined
group_write(instance, value)Generic write called for channels without put defined
prepare_data()Generate the autosave dictionary.
restore_from_file(filename)Restore from the autosave file.
restore_values(data)Restore given the autosave file
datadictionary.save([data])Save autosave
datadictionary with the file manager.Attributes
default_valuesfilenameperiodtype_maptype_map_read_onlypvdbattr_pvdbattr_to_pvnamegroupspvproperty methods
- autosave_hook.startup(self, instance, async_lib)¶
A startup hook which lives until the IOC exits.
Initially restores values from the autosave file self.filename, then periodically - at self.period seconds - saves autosave data to self.filename.
Source code: autosave_hook.startup
219 @autosave_hook.startup 220 async def autosave_hook(self, instance, async_lib): 221 """ 222 A startup hook which lives until the IOC exits. 223 224 Initially restores values from the autosave file `self.filename`, then 225 periodically - at `self.period` seconds - saves autosave data to 226 `self.filename`. 227 """ 228 await self.restore_from_file(self.filename) 229 while True: 230 await async_lib.library.sleep(self.period) 231 await self.save()