SyncApiClient

interface SyncApiClient : ClientEventEmitter<SyncEvents>

Inheritors

Properties

Link copied to clipboard
abstract val currentSyncState: StateFlow<SyncState>

Functions

Link copied to clipboard
abstract suspend fun cancel(wait: Boolean = false)
Link copied to clipboard
abstract suspend fun emit(events: SyncEvents)
Link copied to clipboard
abstract suspend fun start(filter: String? = null, setPresence: Presence? = null, getBatchToken: suspend () -> String?, setBatchToken: suspend (String) -> Unit, timeout: Long = 30000, withTransaction: suspend (block: suspend () -> Unit) -> Unit, asUserId: UserId? = null, wait: Boolean = false, scope: CoroutineScope)
Link copied to clipboard
suspend fun SyncApiClient.start(filter: String? = null, setPresence: Presence? = null, getBatchToken: suspend () -> String?, setBatchToken: suspend (String) -> Unit, timeout: Long = 30000, asUserId: UserId? = null, wait: Boolean = false, scope: CoroutineScope)
Link copied to clipboard
abstract suspend fun <T> startOnce(filter: String? = null, setPresence: Presence? = null, getBatchToken: suspend () -> String?, setBatchToken: suspend (String) -> Unit, timeout: Long = 0, withTransaction: suspend (block: suspend () -> Unit) -> Unit, asUserId: UserId? = null, runOnce: suspend (Sync.Response) -> T): Result<T>
Link copied to clipboard
suspend fun SyncApiClient.startOnce(filter: String? = null, setPresence: Presence? = null, getBatchToken: suspend () -> String?, setBatchToken: suspend (String) -> Unit, timeout: Long = 0, withTransaction: suspend (block: suspend () -> Unit) -> Unit = { it() }, asUserId: UserId? = null): Result<Unit>
suspend fun <T> SyncApiClient.startOnce(filter: String? = null, setPresence: Presence? = null, getBatchToken: suspend () -> String?, setBatchToken: suspend (String) -> Unit, timeout: Long = 0, asUserId: UserId? = null, runOnce: suspend (Sync.Response) -> T): Result<T>
Link copied to clipboard
abstract suspend fun stop(wait: Boolean = false)
Link copied to clipboard
abstract fun subscribe(priority: Int, subscriber: suspend (SyncEvents) -> Unit): Unsubscriber
Link copied to clipboard
abstract suspend fun sync(filter: String? = null, since: String? = null, fullState: Boolean = false, setPresence: Presence? = null, timeout: Long = 0, asUserId: UserId? = null): Result<Sync.Response>

This is the plain sync request. If you want to subscribe to events and ore, use start or startOnce.