MatrixClientStarted
class MatrixClientStarted(delegate: MutableStateFlow<Boolean> = MutableStateFlow(false)) : StateFlow<Boolean>
Functions
Link copied to clipboard
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
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.
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.