caproto.server.autosave.AutosaveHelper¶
-
class
caproto.server.autosave.AutosaveHelper(*args, file_manager: caproto.server.autosave.RotatingFileManager = 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_onlypvproperty 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
218 219 220 221 222 223 224 225 226 227 228 229 230
@autosave_hook.startup async def autosave_hook(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`. """ await self.restore_from_file(self.filename) while True: await async_lib.library.sleep(self.period) await self.save()
-