RemoteStorage.Sync

What this class does is basically six things

  • retrieving the remote version of relevant documents and folders
  • add all local and remote documents together into one tree
  • push local documents out if they don’t exist remotely
  • push local changes out to remote documents (conditionally, to avoid race conditions where both have changed)
  • adopt the local version of a document to its remote version if both exist and they differ
  • delete the local version of a document if it was deleted remotely
  • if any get requests were waiting for remote data, resolve them once this data comes in.

It does this using requests to documents, and to folders.  Whenever a folder GET comes in, it gives information about all the documents it contains (this is the `markChildren` function).

Summary
RemoteStorage.Sync
Functions
sync
getSyncIntervalGet the value of the sync interval when application is in the foreground
setSyncIntervalSet the value of the sync interval when application is in the foreground
getBackgroundSyncIntervalGet the value of the sync interval when application is in the background
setBackgroundSyncIntervalSet the value of the sync interval when the application is in the background
getCurrentSyncIntervalGet the value of the current sync interval

Functions

sync

sync: function ()

getSyncInterval

RemoteStorage.prototype.getSyncInterval = function ()

Get the value of the sync interval when application is in the foreground

Returns a number of milliseconds

setSyncInterval

RemoteStorage.prototype.setSyncInterval = function (interval)

Set the value of the sync interval when application is in the foreground

Parameters

intervalsync interval in milliseconds

getBackgroundSyncInterval

RemoteStorage.prototype.getBackgroundSyncInterval = function ()

Get the value of the sync interval when application is in the background

Returns a number of milliseconds

setBackgroundSyncInterval

RemoteStorage.prototype.setBackgroundSyncInterval = function (interval)

Set the value of the sync interval when the application is in the background

Parameters

intervalsync interval in milliseconds

getCurrentSyncInterval

RemoteStorage.prototype.getCurrentSyncInterval = function ()

Get the value of the current sync interval

Returns a number of milliseconds

sync: function ()
RemoteStorage.prototype.getSyncInterval = function ()
Get the value of the sync interval when application is in the foreground
RemoteStorage.prototype.setSyncInterval = function (interval)
Set the value of the sync interval when application is in the foreground
RemoteStorage.prototype.getBackgroundSyncInterval = function ()
Get the value of the sync interval when application is in the background
RemoteStorage.prototype.setBackgroundSyncInterval = function (interval)
Set the value of the sync interval when the application is in the background
RemoteStorage.prototype.getCurrentSyncInterval = function ()
Get the value of the current sync interval
Close