Enum WaitForSyncMode
An enum controlling when query.SubscribeAsync will wait for synchronization before returning.
Namespace: Realms.Sync
Assembly: Realm.dll
Syntax
public enum WaitForSyncMode
Remarks
When the [Subscription] is created for the first time, data needs to be downloaded from the
server before it becomes available, so depending on whether you run the query against the local
database before or after this has happened, you query results might not look correct.
This enum thus defines the behaviour of when the query is run, so it possible to make the
appropriate tradeoff between correctness and availability.
Fields
Name | Description |
---|---|
FirstTime | This mode will wait for the server data the first time a subscription is created before
returning the local query. Later calls to query.SubscribeAsync
will detect that the subscription already exist and return immediately.
|
Always | With this mode enabled, Realm will always download the latest server state before returning from query.SubscribeAsync. This means that your query result is always seeing the latest data, but it also requires the app to be online. |
Never | With this mode enabled, Realm will always return as soon as the the subscription is created while any server data is being downloaded in the background. This update is not atomic, which means that if you subscribe to notifications using SubscribeForNotifications<T>(IQueryable<T>, NotificationCallbackDelegate<T>, KeyPathsCollection?) or CollectionChanged you might see multiple events being fired as the server sends objects matching the subscription. |