Module Simantics/Backup

This module is undocumented. This is a list of its definitions.

backup :: String -> Integer -> <Proc> ()

backup targetDirectory revision takes a backup of the workspace into the given directory, creating it if needed, by running every registered backup provider. The providers do their work on a background thread, so this returns before the backup is complete and a failure during it is reported to the error log rather than raised here.

modelledBackup :: <a> () -> (String -> Integer -> <a> () -> <a> Maybe String) -> <a> () -> (String -> Integer -> <a> ()) -> <Proc> IBackupProvider

modelledBackup lock backup unlock restore builds a backup provider out of four SCL functions.

lock is called before the backup starts and unlock after every provider has been started, and between them the state to be copied must not change. backup targetDirectory revision is called between them and returns the function that does the copying; that function runs on its own thread and returns Nothing when it succeeded and Just message when it failed. restore fromDirectory revision reads a backup back in.