All Downloads are FREE. Search and download functionalities are using the official Maven repository.

r.0.9.1.source-code.TotalOrderedLogExt.kt Maven / Gradle / Ivy

The newest version!
package se.wollan.tolr

import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.flow

suspend fun TotalOrderedLog.listRecordsByType(pattern: RecordTypePattern): Flow = flow {
    var since: NodeTimestamp = NodeTimestamp.initial
    while (true) {
        val page = listRecordsByTypeLaterThan(pattern, since)
        for (r in page.records)
            emit(r)

        since = page.next ?: break
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy