SyncSession
interface SyncSession
Content copied to clipboard
A session controls how data is synchronized between a single Realm on the device and MongoDB on the server.
A SyncSession
is created by opening a Realm instance using a SyncConfiguration. Once a session has been created, it will continue to exist until the app is closed or the Realm is closed.
A session is controlled by Realm, but can provide additional information in case of errors. These errors are passed along in the ErrorHandler.
When creating a session, Realm will establish a connection to the server. This connection is controlled by Realm and might be shared between multiple sessions.
The session itself has a different lifecycle than the underlying connection.
The SyncSession object is thread safe.
Types
ErrorHandler
Link copied to clipboard
fun fun interface ErrorHandler
Content copied to clipboard
State
Link copied to clipboard
Functions
downloadAllServerChanges
Link copied to clipboard
abstract suspend fun downloadAllServerChanges(timeout: Duration = Duration.INFINITE): Boolean
Content copied to clipboard
uploadAllLocalChanges
Link copied to clipboard
abstract suspend fun uploadAllLocalChanges(timeout: Duration = Duration.INFINITE): Boolean
Content copied to clipboard
Properties
state
Link copied to clipboard