SyncApiClientImpl

class SyncApiClientImpl(httpClient: MatrixClientServerApiHttpClient, syncLoopDelay: Duration, syncLoopErrorDelay: Duration, clock: Clock = Clock.System) : ClientEventEmitterImpl<SyncEvents> , SyncApiClient

Constructors

Link copied to clipboard
constructor(httpClient: MatrixClientServerApiHttpClient, syncLoopDelay: Duration, syncLoopErrorDelay: Duration, clock: Clock = Clock.System)

Properties

Link copied to clipboard
open override val currentSyncState: StateFlow<SyncState>

Functions

Link copied to clipboard
open suspend override fun cancel(wait: Boolean)
Link copied to clipboard
open suspend override fun emit(events: SyncEvents)
Link copied to clipboard
open suspend override fun start(filter: String?, setPresence: Presence?, getBatchToken: suspend () -> String?, setBatchToken: suspend (String) -> Unit, timeout: Duration, withTransaction: suspend (block: suspend () -> Unit) -> Unit, asUserId: UserId?, wait: Boolean, scope: CoroutineScope)
Link copied to clipboard
open suspend override fun <T> startOnce(filter: String?, setPresence: Presence?, getBatchToken: suspend () -> String?, setBatchToken: suspend (String) -> Unit, timeout: Duration, withTransaction: suspend (block: suspend () -> Unit) -> Unit, asUserId: UserId?, 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: Duration = ZERO, withTransaction: suspend (block: suspend () -> Unit) -> Unit = { it() }, asUserId: UserId? = null): Result<Unit>
Link copied to clipboard
open suspend override fun stop(wait: Boolean)
Link copied to clipboard
open override fun subscribe(priority: Int, subscriber: Subscriber<SyncEvents>): Unsubscriber
Link copied to clipboard
open suspend override fun sync(filter: String?, since: String?, fullState: Boolean, setPresence: Presence?, timeout: Duration, asUserId: UserId?): Result<Sync.Response>

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