Incoming Synchronization Modes

The Engine v8.1 provides 3 synchronization modes:

  • Timer pooling mode.
  • CRUDE + manual pooling mode.
  • Sync ID algorithm mode.

You can set the mode by setting the IncomingSyncMode of the EngineWindows.SyncService object:

Engine.SyncService.IncomingSyncMode = IncomingSyncMode.TimerPooling;

// Set sync interval for both incoming and outgoing sync.
Engine.SyncService.SyncIntervalMs = Settings.SyncIntervalMs;

Timer Pooling Synchronization

The timer pooling mode is new to the Engine v8.1 and is supported on both Windows and macOS platforms. You will use this mode if your remote storage does not provide any notifications about items changes. To set Engine to timer pooling mode, set the IncomingSyncMode property to IncomingSyncMode.TimerPooling value.

Engine.SyncService.IncomingSyncMode = IncomingSyncMode.TimerPooling;

// Set sync interval for both incoming and outgoing sync.
Engine.SyncService.SyncIntervalMs = Settings.SyncIntervalMs;

In this mode the Engine will traverse all folders loaded on the client and will call IFolder.GetChildrenAsync() for each folder to get new folder content from your remote storage. The Engine will compare folder content and create, update and delete items on the client. To find if an item content or metadata is modified the Engine will use IFileSystemItemMetadata.MetadataETag and IFileMetadata.ContentETag properties. See the Detecting Content and Metadata Changes article for more details.

CRUDE + Manual Pooling Synchronization

In case your remote storage provides updates via create, update, delete and move events via web sockets you will typically disable incoming synchronization by setting the incoming sync mode to IncomingSyncMode.Disabled:

Engine.SyncService.IncomingSyncMode = IncomingSyncMode.Disabled;

To sync all changes that happened when the Engine was not running or sockets were disconnected you will trigger one-time pooling synchronization by calling the IncomingPoolingSync.ProcessAsync() method:

await Engine.SyncService.IncomingPooling.ProcessAsync();

Find more about how to implement this mode in the CRUDE Incoming Synchronization article.

Sync ID Synchronization

The Sync ID mode is set by IncomingSyncMode.SyncId enum value. In this mode the Engine will try to get the initial sync ID by calling ISynchronizationCollection.GetChagesAsync() on Engine start. You will trigger all subsequent synchronizations by calling IServerCollectionNotifications.ProcessChangesAsync() from your remote storage monitor when any changes in remote storage occur. The Sync ID mode is described in details in this article

Next Article:

CRUDE Incoming Synchronization