Ditto 4.8.1-rc.1
Loading...
Searching...
No Matches
DittoSDK.DittoSync Class Reference

Provides access to sync related functionality of Ditto. More...

Public Member Functions

DittoSyncSubscription RegisterSubscription (string query, Dictionary< string, object > arguments=default)
 Installs and returns a sync subscription for a query, configuring Ditto to receive updates from other peers for documents matching that query. The passed in query must be a SELECT query, otherwise a DittoQueryNotSupportedException will be thrown.
 

Properties

IReadOnlyCollection< DittoSyncSubscription > Subscriptions [get]
 Gets all currently active sync subscriptions.
 

Detailed Description

Provides access to sync related functionality of Ditto.

Member Function Documentation

◆ RegisterSubscription()

DittoSyncSubscription DittoSDK.DittoSync.RegisterSubscription ( string query,
Dictionary< string, object > arguments = default )
inline

Installs and returns a sync subscription for a query, configuring Ditto to receive updates from other peers for documents matching that query. The passed in query must be a SELECT query, otherwise a DittoQueryNotSupportedException will be thrown.

Parameters
queryA string containing a valid query expressed in DQL.
argumentsA dictionary of values keyed by the placeholder name without the leading :
Example:
new Dictionary<string, object>() { { "mileage" , 123 } }
Returns
An active DittoSyncSubscription for the passed in query and arguments. You'll have to keep it to be able to cancel the sync subscription. Otherwise it will remain active until the owning Ditto object goes out of scope.
Exceptions
DittoStoreExceptionCan throw a DittoStoreException. For more granular exception handling check the following subtypes: