caproto.server.autosave.AutosaveHelper

Inheritance diagram of AutosaveHelper
class caproto.server.autosave.AutosaveHelper(*args, file_manager: Optional[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 data dictionary.

save([data])

Save autosave data dictionary with the file manager.

Attributes

default_values

filename

period

type_map

type_map_read_only

pvproperty 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@autosave_hook.startup
219async def autosave_hook(self, instance, async_lib):
220    """
221    A startup hook which lives until the IOC exits.
222
223    Initially restores values from the autosave file `self.filename`, then
224    periodically - at `self.period` seconds - saves autosave data to
225    `self.filename`.
226    """
227    await self.restore_from_file(self.filename)
228    while True:
229        await async_lib.library.sleep(self.period)
230        await self.save()