CurrentSyncState

class CurrentSyncState(currentSyncState: StateFlow<SyncState>) : StateFlow<SyncState>

Constructors

Link copied to clipboard
constructor(currentSyncState: StateFlow<SyncState>)
constructor(api: MatrixClientServerApiClient)

Properties

Link copied to clipboard
open override val replayCache: List<SyncState>
Link copied to clipboard
open override val value: SyncState

Functions

Link copied to clipboard
open suspend override fun collect(collector: FlowCollector<SyncState>): Nothing
Link copied to clipboard
Link copied to clipboard
@JvmName(name = "flattenList")
inline fun <V> Flow<List<Flow<V?>>>.flatten(throttle: Duration = 200.milliseconds): Flow<List<V>>
fun <K, V> Flow<Map<K, Flow<V?>>>.flatten(throttle: Duration = 200.milliseconds): Flow<Map<K, V?>>

A change of the outer flow results in new collect of the inner flows. Because this is an expensive operation, the outer flow is throttled by default.

Link copied to clipboard
fun <K, V> Flow<Map<K, Flow<V?>>>.flattenNotNull(throttle: Duration = 200.milliseconds): Flow<Map<K, V>>

A change of the outer flow results in new collect of the inner flows. Because this is an expensive operation, the outer flow is throttled by default.

Link copied to clipboard
inline fun <K, V> Flow<Map<K, Flow<V?>>>.flattenValues(throttle: Duration = 200.milliseconds): Flow<List<V>>

A change of the outer flow results in new collect of the inner flows. Because this is an expensive operation, the outer flow is throttled by default.

fun Flow<Map<RoomId, Flow<Room?>>>.flattenValues(throttle: Duration = 200.milliseconds, filterUpgradedRooms: Boolean = true): Flow<Set<Room>>

This collects all rooms, so when one changes, a new set gets emitted. A change of the outer flow results in new collect of the inner flows. Because this is an expensive operation, the outer flow is throttled by default.

Link copied to clipboard
suspend fun <T> StateFlow<SyncState>.retry(delayConfigWhenSyncRunning: RetryFlowDelayConfig = RetryFlowDelayConfig().copy(scheduleLimit = 10.seconds), delayConfigWhenSyncNotRunning: RetryFlowDelayConfig = RetryFlowDelayConfig(), onError: suspend (error: Throwable, delay: Duration) -> Unit = { _, _ -> }, block: suspend () -> T): T
Link copied to clipboard
fun <T> StateFlow<SyncState>.retryFlow(delayConfigWhenSyncRunning: RetryFlowDelayConfig = RetryFlowDelayConfig().copy(scheduleLimit = 10.seconds), delayConfigWhenSyncNotRunning: RetryFlowDelayConfig = RetryFlowDelayConfig(), onError: suspend (error: Throwable, delay: Duration) -> Unit = { _, _ -> }, block: suspend FlowCollector<T>.() -> Unit): Flow<T>
Link copied to clipboard
suspend fun StateFlow<SyncState>.retryLoop(delayConfigWhenSyncRunning: RetryFlowDelayConfig = RetryFlowDelayConfig().copy(scheduleLimit = 10.seconds), delayConfigWhenSyncNotRunning: RetryFlowDelayConfig = RetryFlowDelayConfig(), onError: suspend (error: Throwable, delay: Duration) -> Unit = { _, _ -> }, block: suspend () -> Unit)
Link copied to clipboard
@JvmName(name = "toList")
fun Flow<Flow<TimelineEvent>>.toFlowList(maxSize: StateFlow<Int>, minSize: MutableStateFlow<Int> = MutableStateFlow(0)): Flow<List<Flow<TimelineEvent>>>

Converts a flow of timeline events into a flow of list of timeline events limited by maxSize.

@JvmName(name = "toListFromLatest")
fun Flow<Flow<Flow<TimelineEvent>>?>.toFlowList(maxSize: StateFlow<Int>, minSize: MutableStateFlow<Int> = MutableStateFlow(0)): Flow<List<Flow<TimelineEvent>>>

Converts a flow of flows of timeline event into a flow of list of timeline events limited by maxSize.